wiki/More_(command)
more [options] [file_name]
-num: This option specifies an integer which is the screen size (in lines).
哦,原来参数写错了,我是说macos里执行more -2
怎么无效
MacOS里面执行
> man more
less - opposite of more
-n or --line-numbers
Suppresses line numbers. The default (to use line numbers) may cause less to run more slowly in some cases, especially with a very large input file. Suppressing line numbers with the -n option will avoid this problem. Using line numbers means: the line number will be dis played in the verbose prompt and in the = command, and the v command will pass the current line number to the editor (see also the dis cussion of LESSEDIT in PROMPTS below).
> more -n 3 long.txt
# 每次输出2行, 怎么少了1行?
Linux 里
> man more
more - file perusal filter for crt viewing
-number
The screen size to use, in number of lines.
> more -3 long.txt
# 每次输出3行
但 -n or --line-numbers
的描述看起来不是限制每次输出行数啊。
那段英文到底什么意思啊
1
azh7138m 2019-08-29 18:49:17 +08:00
less
Less is a program similar to more (1) |
2
gIrl1990 OP |
3
misaka19000 2019-08-29 19:27:43 +08:00
less is more
|
4
sleepm 2019-08-29 19:37:35 +08:00 via Android
写的很清楚了,more -num filename
再举个例子 rm -rf / 一般我们写 rm / -rf 但是在 mac 中 -rf 会被当成文件 |
5
azh7138m 2019-08-29 19:50:00 +08:00
这个需求是 split
shell 循环读输出就行 |
7
azh7138m 2019-08-29 20:39:20 +08:00
我觉得是个 X-Y PROBLEM
https://coolshell.cn/articles/10804.html |
9
azh7138m 2019-08-29 20:57:03 +08:00
如果你坚持用 shell 处理,直接读入数组,每一项就是一行
我还是觉得是个 X-Y PROBLEM 为了一个不存在的问题,在反复 hack |
10
jmc891205 2019-08-29 21:20:48 +08:00
less 没有你想要的功能
|
11
gIrl1990 OP MacOS:
```bash > gsha1sum /usr/bin/more /usr/bin/less 6f6ec068da5870eb28b04d0cc50abc5ec5e4b85e /usr/bin/more 6f6ec068da5870eb28b04d0cc50abc5ec5e4b85e /usr/bin/less # 这两个是同一个文件? > more --version less 487 (POSIX regular expressions) Copyright (C) 1984-2016 Mark Nudelman less comes with NO WARRANTY, to the extent permitted by law. For information about the terms of redistribution, see the file named README in the less distribution. Homepage: http://www.greenwoodsoftware.com/less > more -n 3 long.txt # 可以实现 linux 里 more 的效果 > less -n 3 long.txt # 既然是同样文件,为何出错? ``` 那如果他们不同,从 Homepage 下载到的源码如何编译出 more 命令? |
12
gIrl1990 OP |