您的位置:首页 > 其它

19.分屏查看命令 more命令

2019-01-12 21:31 1096 查看
more命令:
特点:翻屏至文件尾部后自动退出;

more 命令类似 cat ,不过会以一页一页的形式显示,更方便使用者逐页阅读,而最基本的指令就是按空白键(space)就往下一页显示,按 b 键就会往回(back)一页显示,而且还有搜寻字串的功能(与 vi 相似),使用中的说明文件,请按 h 。

该命令一次 16c8 显示一屏文本,满屏后停下来,并且在屏幕的底部出现一个提示信息,给出至今己显示的该文件的百分比:--More--(XX%)可以用下列不同的方法对提示做出回答:

按Space键:显示文本的下一屏内容。
按Enier键:只显示文本的下一行内容。
按斜线符|:接着输入一个模式,可以在文本中寻找下一个相匹配的模式。
按H键:显示帮助屏,该屏上有相关的帮助信息。
按B键:显示上一屏内容。
按Q键:退出rnore命令。
选项:

-<数字>:指定每屏显示的行数;
+<数字>:从指定数字的行开始显示;
-p 不以卷动的方式显示每一页,而是先清除萤幕后再显示内容

more以后可以使用的操作命令(按h 弹出)

空格键 向下滚动一屏
z Display next k lines of text [current screen size]
<return> Display next k lines of text [1]
d or ctrl-D Scroll k lines [current scroll size, initially 11]*
q or Q or <interrupt> 退出more
s Skip forward k lines of text [1]
f Skip forward k screenfuls of text [1]
b or ctrl-B 返回上一屏
' 跳转到上次查找开始的位置
= 输出当前行的行号
/
模式 查找符合模式的内容,按n为下一个,N为上一个
n Search for kth occurrence of last r.e [1]
!命令 or :! 命令 调用Shell,并执行命令
v 调用vi
ctrl-L Redraw screen
:n Go to kth next file [1]
:p Go to kth previous file [1]
:f 输出文件名和当前行的行号
. 执行上一个命令

实例:

[root@localhost tmp]# more functions

每次显示5行

[root@localhost tmp]# more -5 functions
# -*-Shell-script-*-
#
# functions This file contains functions to be used by most or all
#       shell scripts in the /etc/init.d directory.
#
--More--(0%)

按空格键显示5-10行,不清屏

[root@localhost tmp]# more -5 functions
# -*-Shell-script-*-
#
# functions This file contains functions to be used by most or all
#       shell scripts in the /etc/init.d directory.
#

TEXTDOMAIN=initscripts

# Make sure umask is sane
umask 022
--More--(1%)

每次显示5行,清屏显示

[root@localhost tmp]# more -p -5 functions
# -*-Shell-script-*-
#
# functions This file contains functions to be used by most or all
#       shell scripts in the /etc/init.d directory.
#
--More--(0%)

more +10   从第 10 行开始显示functions中的内容。

[root@localhost tmp]# more +10 functions

umask 022
# Set up a default search path.
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
export PATH
--More--(4%)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  more 分屏 查看命令