本文为joshua317原创文章,转载请注明:转载自joshua317博客 https://www.joshua317.com/article/141
Linux more 命令在我们查看文件的时候,可以一页一页的进行显示,逐页阅读,而最基本的指令就是按空白键(space)就往下一页显示,按 b 键就会往回(back)一页显示,而且还有搜寻字串的功能(与 vi 相似),使用中的说明文件,按 h
more [options] file...
more [参数] 文件...
Usage: more [options] file...
Options:
-d display help instead of ring bell
-f count logical, rather than screen lines
-l suppress pause after form feed
-p do not scroll, clean screen and display text
-c do not scroll, display text and clean line ends
-u suppress underlining
-s squeeze multiple blank lines into one
-NUM specify the number of lines per screenful
+NUM display file beginning from line number NUM
+/STRING display file beginning from search string match
-V output version information and exit
-d 提示使用者,在画面下方显示 [Press space to continue, 'q' to quit.] ,如果使用者按错键,则会显示 [Press 'h' for instructions.] 而不是 '哔' 声
-f 计算行数时,以实际上的行数,而非自动换行过后的行数(有些单行字数太长的会被扩展为两行或两行以上)
-l 取消遇见特殊字元 ^L(送纸字元)时会暂停的功能
-p 不以卷动的方式显示每一页,而是先清除萤幕后再显示内容
-c 跟 -p 相似,不同的是先显示内容再清除其他旧资料
-u 不显示下引号 (根据环境变数 TERM 指定的 terminal 而有所不同)
-s 当遇到有连续两行以上的空白行,就代换为一行的空白行
+NUM 从第 num 行开始显示,如more +1 tree.txt
-NUM 一次显示的行数,more -1 tree.txt
+/STRING 在每个文档显示前搜寻该字串(STRING),然后从该字串之后开始显示
fileNames 欲显示内容的文档,可为复数个数
more命令和cat的功能一样都是查看文件里的内容,但有所不同的是more可以按页来查看文件的内容,还支持直接跳转行等功能。
more /var/log/messages
more +20 /var/log/messages
more -5 /var/log/messages
more +/systemd /var/log/messages
more -s /var/log/messages
本文为joshua317原创文章,转载请注明:转载自joshua317博客 https://www.joshua317.com/article/141