2023年8月2日发(作者:)
Linux⽇志查看more命令more命令是⼀个基于vi编辑器⽂本过滤器,它以全屏幕的⽅式按页显⽰⽂本⽂件的内容,⽀持vi中的关键字定位操作。more名单中内置了若⼲快捷键,常⽤的有H(获得帮助信息),Enter(向下翻滚⼀⾏),空格(向下滚动⼀屏),Q(退出命令)。more命令从前向后读取⽂件,因此在启动时就加载整个⽂件。该命令⼀次显⽰⼀屏⽂本,满屏后停下来,并且在屏幕的底部出现⼀个提⽰信息,给出⾄今⼰显⽰的该⽂件的百分⽐:–More–(XX%)可以⽤下列不同的⽅法对提⽰做出回答:1. 按Space键:显⽰⽂本的下⼀屏内容;2. 按Enier键:只显⽰⽂本的下⼀⾏内容;3. 按斜线符|:接着输⼊⼀个模式,可以在⽂本中寻找下⼀个相匹配的模式;4. 按H键:显⽰帮助屏,该屏上有相关的帮助信息;5. 按B键:显⽰上⼀屏内容;6. 按Q键:退出more命令。NAME(名称) more - file perusal filter for crt viewing ⽂件过滤器SYNOPSIS(概要,⼤纲) more [options] file [...]DESCRIPTION(描述) more is a filter for paging through text one screenful at a time.
This version is especially primitive.
Users should realize that less(1) provides more(1) emulation plus extensive enhancements. more 命令以全屏幕的⽅式按页显⽰⽂本⽂件的内容。 这个版本特别原始。 ⽤户应该了解 less 命令提供了⽐ more 命令更多更强⼤的功能。OPTIONS(选项) Command-line options are described below.
Options are also taken from the environment variable MORE (make sure to precede them with a dash (``-''))
but command line options will override them. 命令⾏选项如下所⽰。 这些选项也可以从环境变量 MORE 中获得(确保在这些选项前⾯有“-”) 另外,命令⾏选项可以覆盖他们。 -number This option specifies an integer number which is the screen size (in lines). 指定每屏显⽰的⾏数为 number -d more will prompt the user with the message "[Press space to continue, 'q' to quit.]"
and will display "[Press 'h' for instructions.]" instead of ringing the bell when an illegal key is pressed. 提⽰使⽤者,在画⾯下⽅显⽰ [Press space to continue, 'q' to quit.] , 如果使⽤者按错键,则会显⽰ [Press 'h' for instructions.] ⽽不是 '哔' 声 -l more usually treats ^L (form feed) as a special character,
and will pause after any line that contains a form feed.
The -l option will prevent this behavior. 取消遇见特殊字元 ^L(送纸字元)时会暂停的功能 -f Causes more to count logical, rather than screen lines (i.e., long lines are not folded). 计算⾏数时,以实际上的⾏数,⽽⾮⾃动换⾏过后的⾏数(有些单⾏字数太长的会被扩展为两⾏或两⾏以上) -p Do not scroll. Instead, clear the whole screen and then display the text.
Notice that this option is switched on automatically if the executable is named page. 不以滚动的⽅式显⽰每⼀页,⽽是先清除萤幕后再显⽰内容。 注意,如果可执⾏⽂件被命名为page,那么这个选项就会⾃动打开。 注意,如果可执⾏⽂件被命名为page,那么这个选项就会⾃动打开。 -c Do not scroll. Instead, paint each screen from the top, clearing the remainder of each line as it is displayed. 跟 -p 相似,不同的是先显⽰内容再清除其他旧资料 -s Squeeze multiple blank lines into one. 当遇到有连续两⾏以上的空⽩⾏,就代换为⼀⾏的空⽩⾏ -u Suppress underlining. 不显⽰下划线(根据环境变数 TERM 指定的 terminal ⽽有所不同) +/ The +/ option specifies a string that will be searched for before each file is displayed. 在每个⽂档显⽰前搜寻该字串(string),然后从该字串之后开始显⽰ +number Start at line number. 从⽂件第 number ⾏开始显⽰COMMANDS(命令) Interactive commands for more are based on vi(1).
Some commands may be preceded by a decimal number, called k in the descriptions below.
In the following descriptions, ^X means control-X. more 的交互命令是基于 vi 的。 h or ? Help: display a summary of these commands.
If you forget all the other commands, remember this one. 显⽰所有命令及功能解释。 SPACE Display next k lines of text. Defaults to current screen size. 显⽰⽂件接下来的 k ⾏。默认为当前的屏幕⼤⼩。 z Display next k lines of text. Defaults to current screen size. Argument becomes new default. 显⽰接下来的 k ⾏。默认为当前的屏幕⼤⼩。使⽤后参数变成默认的。 RETURN Display next k lines of text. Defaults to 1. Argument becomes new default. 显⽰接下来的 k ⾏。默认为当前的屏幕⼤⼩。使⽤后参数变成默认的。 d or ^D Scroll k lines. Default is current scroll size, initially 11. Argument becomes new default. 向下滚动 k ⾏,默认为当前的滚动⼤⼩,初始值是11。使⽤后参数变成默认的。 q or Q or INTERRUPT Exit. 退出 s Skip forward k lines of text. Defaults to 1. 跳过 k ⾏。并向前滚动。默认为 1。 f Skip forward k screenfuls of text. Defaults to 1. 跳过 k 个整屏的⽂本。默认为 1。 b or ^B Skip backwards k screenfuls of text. Defaults to 1. Only works with files, not pipes. 跳过k个⼤屏幕的⽂本。默认为1。只处理⽂件,⽽不是管道。 ´ Go to place where previous search started. 跳转到之前搜索开始的地⽅。 = Display current line number. 显⽰当前的⾏数。 /pattern Search for kth occurrence of regular expression. Defaults to 1. 查找正则表达式的第k次出现。默认为1。 n Search for kth occurrence of last regular expression. Defaults to 1. 查找正则表达式的倒数第k次出现。默认为1。 !command or :!command !command or :!command Execute command in a subshell. 在⼦shell中执⾏命令。 v Start up an editor at current line.
The editor is taken from the environment variable VISUAL if defined,
or EDITOR if VISUAL is not defined, or defaults to vi if neither VISUAL nor EDITOR is defined. 在当前⾏启动编辑器。 如果定义了环境变量,那么编辑器就会从环境变量中获取,如果没有定义, 那么编辑器将被定义为vi,如果没有定义可视化和编辑器,则默认为vi。 ^L Redraw screen. 屏幕重绘 :n Go to kth next file. Defaults to 1. 向前跳转到第K个⽂件 :P Go to kth previous file. Defaults to 1. 向回跳转到第K个⽂件 :f Display current file name and line number. 显⽰当前的⽂件名称和⾏号 . Repeat previous command. 重复上⼀个命令ENVIRONMENT(环境) More utilizes the following environment variables, if they exist: 如果存在以下环境变量,More将使⽤以下环境变量: MORE This variable may be set with favored options to more. 这个变量可以设置more常⽤的选项。 SHELL Current shell in use (normally set by the shell at login time). 当前使⽤的shell(通常在登录时由shell设置)。 TERM Specifies terminal type, used by more to get the terminal characteristics necessary to manipulate the screen. 指定终端类型,更多地⽤于获取操作屏幕所需的终端特征。 VISUAL Editor the user is preferring. Used when key command v is pressed. ⽤户更喜欢的编辑器。在按下键命令v时使⽤。 EDITOR Editor of choise when VISUAL is not specified. 当VISUAL环境变量没有被指定时,使⽤choise编辑器。1、逐页显⽰ ⽂档内容,如有连续两⾏以上空⽩⾏则以⼀⾏空⽩⾏显⽰。[root@peipei3514 usr]# more -s 1 2018-03-02 12:39:06:698 YZXBB2 2018-03-03 12:40:16:700 VGLHY3 2018-03-04 12:41:17:701 XANRN 4 2018-03-05 12:42:22:701 RXNYJ5 2018-03-06 12:43:14:701 BBUEM6 2018-03-07 12:44:14:701 FKYDL7 2018-03-08 12:45:08:701 KAHMA8 2018-03-09 12:46:14:702 GZZXG9 2018-03-10 12:47:16:702 OEVDO10 2018-03-11 12:48:06:702 ALXQQ11 2018-03-12 12:49:10:702 HOCSQ--More--(5%)2、从第 20 ⾏开始显⽰ testfile 之⽂档内容。[root@peipei3514 usr]# more +20 220 2018-10-07 19:09:36:781 DJAOD221 2018-10-08 19:10:31:781 TBYYK222 2018-10-09 19:11:30:781 LYYPT223 2018-10-10 19:12:37:781 AXVWT224 2018-10-11 19:13:33:781 UXSGR225 2018-10-12 19:14:34:781 TBMJP226 2018-10-13 19:15:33:781 IMNNK227 2018-10-14 19:16:23:781 LHEGY228 2018-10-15 19:17:37:782 YMZPO--More--(14%)3、从⽂件中查找第⼀个出现"ZCJ"字符串的⾏,并从该处前两⾏开始显⽰输出[root@peipei3514 usr]# more +/ZCJ ...跳过203 2018-09-20 18:52:37:779 UZDCE204 2018-09-21 18:53:40:779 NCISH205 2018-09-22 18:54:34:779 ZCJUY206 2018-09-23 18:55:38:779 SEJKZ207 2018-09-24 18:56:27:779 CNGMW208 2018-09-25 18:57:31:779 GLILU209 2018-09-26 18:58:24:779 VWUSO210 2018-09-27 18:59:39:779 HDRAT211 2018-09-28 19:00:40:779 CFGHE212 2018-09-29 19:01:41:780 VHLIB213 2018-09-30 19:02:34:780 NMJPE214 2018-10-01 19:03:29:780 CJWWI215 2018-10-02 19:04:40:780 HISAY--More--(7%)4、设定每屏显⽰⾏数[root@peipei3514 usr]# more -5 201 2018-09-18 18:50:25:778 ZHWKD202 2018-09-19 18:51:26:778 VQGRP203 2018-09-20 18:52:37:779 UZDCE204 2018-09-21 18:53:40:779 NCISH205 2018-09-22 18:54:34:779 ZCJUY--More--(2%)说明:最下⾯显⽰了该屏展⽰的内容占⽂件总⾏数的⽐例,按 Ctrl+F 或者 空格键 将会显⽰下⼀屏5条内容,百分⽐也会跟着变化。5、列⼀个⽬录下的⽂件,由于内容太多,我们应该学会⽤more来分页显⽰。这得和管道 | 结合起来 。[root@peipei3514 usr]# ls -l| more -5总⽤量 116dr-xr-xr-x. 2 root root 20480 12⽉ 29 15:20 bindrwxr-xr-x. 2 root root 6 11⽉ 5 2016 etcdrwxr-xr-x. 2 root root 6 11⽉ 5 2016 gamesdrwxr-xr-x. 3 root root 23 12⽉ 23 23:12 include--More--6、显⽰⽂件接下来的 5 ⾏先按数字键5,再按空格键。
2023年8月2日发(作者:)
Linux⽇志查看more命令more命令是⼀个基于vi编辑器⽂本过滤器,它以全屏幕的⽅式按页显⽰⽂本⽂件的内容,⽀持vi中的关键字定位操作。more名单中内置了若⼲快捷键,常⽤的有H(获得帮助信息),Enter(向下翻滚⼀⾏),空格(向下滚动⼀屏),Q(退出命令)。more命令从前向后读取⽂件,因此在启动时就加载整个⽂件。该命令⼀次显⽰⼀屏⽂本,满屏后停下来,并且在屏幕的底部出现⼀个提⽰信息,给出⾄今⼰显⽰的该⽂件的百分⽐:–More–(XX%)可以⽤下列不同的⽅法对提⽰做出回答:1. 按Space键:显⽰⽂本的下⼀屏内容;2. 按Enier键:只显⽰⽂本的下⼀⾏内容;3. 按斜线符|:接着输⼊⼀个模式,可以在⽂本中寻找下⼀个相匹配的模式;4. 按H键:显⽰帮助屏,该屏上有相关的帮助信息;5. 按B键:显⽰上⼀屏内容;6. 按Q键:退出more命令。NAME(名称) more - file perusal filter for crt viewing ⽂件过滤器SYNOPSIS(概要,⼤纲) more [options] file [...]DESCRIPTION(描述) more is a filter for paging through text one screenful at a time.
This version is especially primitive.
Users should realize that less(1) provides more(1) emulation plus extensive enhancements. more 命令以全屏幕的⽅式按页显⽰⽂本⽂件的内容。 这个版本特别原始。 ⽤户应该了解 less 命令提供了⽐ more 命令更多更强⼤的功能。OPTIONS(选项) Command-line options are described below.
Options are also taken from the environment variable MORE (make sure to precede them with a dash (``-''))
but command line options will override them. 命令⾏选项如下所⽰。 这些选项也可以从环境变量 MORE 中获得(确保在这些选项前⾯有“-”) 另外,命令⾏选项可以覆盖他们。 -number This option specifies an integer number which is the screen size (in lines). 指定每屏显⽰的⾏数为 number -d more will prompt the user with the message "[Press space to continue, 'q' to quit.]"
and will display "[Press 'h' for instructions.]" instead of ringing the bell when an illegal key is pressed. 提⽰使⽤者,在画⾯下⽅显⽰ [Press space to continue, 'q' to quit.] , 如果使⽤者按错键,则会显⽰ [Press 'h' for instructions.] ⽽不是 '哔' 声 -l more usually treats ^L (form feed) as a special character,
and will pause after any line that contains a form feed.
The -l option will prevent this behavior. 取消遇见特殊字元 ^L(送纸字元)时会暂停的功能 -f Causes more to count logical, rather than screen lines (i.e., long lines are not folded). 计算⾏数时,以实际上的⾏数,⽽⾮⾃动换⾏过后的⾏数(有些单⾏字数太长的会被扩展为两⾏或两⾏以上) -p Do not scroll. Instead, clear the whole screen and then display the text.
Notice that this option is switched on automatically if the executable is named page. 不以滚动的⽅式显⽰每⼀页,⽽是先清除萤幕后再显⽰内容。 注意,如果可执⾏⽂件被命名为page,那么这个选项就会⾃动打开。 注意,如果可执⾏⽂件被命名为page,那么这个选项就会⾃动打开。 -c Do not scroll. Instead, paint each screen from the top, clearing the remainder of each line as it is displayed. 跟 -p 相似,不同的是先显⽰内容再清除其他旧资料 -s Squeeze multiple blank lines into one. 当遇到有连续两⾏以上的空⽩⾏,就代换为⼀⾏的空⽩⾏ -u Suppress underlining. 不显⽰下划线(根据环境变数 TERM 指定的 terminal ⽽有所不同) +/ The +/ option specifies a string that will be searched for before each file is displayed. 在每个⽂档显⽰前搜寻该字串(string),然后从该字串之后开始显⽰ +number Start at line number. 从⽂件第 number ⾏开始显⽰COMMANDS(命令) Interactive commands for more are based on vi(1).
Some commands may be preceded by a decimal number, called k in the descriptions below.
In the following descriptions, ^X means control-X. more 的交互命令是基于 vi 的。 h or ? Help: display a summary of these commands.
If you forget all the other commands, remember this one. 显⽰所有命令及功能解释。 SPACE Display next k lines of text. Defaults to current screen size. 显⽰⽂件接下来的 k ⾏。默认为当前的屏幕⼤⼩。 z Display next k lines of text. Defaults to current screen size. Argument becomes new default. 显⽰接下来的 k ⾏。默认为当前的屏幕⼤⼩。使⽤后参数变成默认的。 RETURN Display next k lines of text. Defaults to 1. Argument becomes new default. 显⽰接下来的 k ⾏。默认为当前的屏幕⼤⼩。使⽤后参数变成默认的。 d or ^D Scroll k lines. Default is current scroll size, initially 11. Argument becomes new default. 向下滚动 k ⾏,默认为当前的滚动⼤⼩,初始值是11。使⽤后参数变成默认的。 q or Q or INTERRUPT Exit. 退出 s Skip forward k lines of text. Defaults to 1. 跳过 k ⾏。并向前滚动。默认为 1。 f Skip forward k screenfuls of text. Defaults to 1. 跳过 k 个整屏的⽂本。默认为 1。 b or ^B Skip backwards k screenfuls of text. Defaults to 1. Only works with files, not pipes. 跳过k个⼤屏幕的⽂本。默认为1。只处理⽂件,⽽不是管道。 ´ Go to place where previous search started. 跳转到之前搜索开始的地⽅。 = Display current line number. 显⽰当前的⾏数。 /pattern Search for kth occurrence of regular expression. Defaults to 1. 查找正则表达式的第k次出现。默认为1。 n Search for kth occurrence of last regular expression. Defaults to 1. 查找正则表达式的倒数第k次出现。默认为1。 !command or :!command !command or :!command Execute command in a subshell. 在⼦shell中执⾏命令。 v Start up an editor at current line.
The editor is taken from the environment variable VISUAL if defined,
or EDITOR if VISUAL is not defined, or defaults to vi if neither VISUAL nor EDITOR is defined. 在当前⾏启动编辑器。 如果定义了环境变量,那么编辑器就会从环境变量中获取,如果没有定义, 那么编辑器将被定义为vi,如果没有定义可视化和编辑器,则默认为vi。 ^L Redraw screen. 屏幕重绘 :n Go to kth next file. Defaults to 1. 向前跳转到第K个⽂件 :P Go to kth previous file. Defaults to 1. 向回跳转到第K个⽂件 :f Display current file name and line number. 显⽰当前的⽂件名称和⾏号 . Repeat previous command. 重复上⼀个命令ENVIRONMENT(环境) More utilizes the following environment variables, if they exist: 如果存在以下环境变量,More将使⽤以下环境变量: MORE This variable may be set with favored options to more. 这个变量可以设置more常⽤的选项。 SHELL Current shell in use (normally set by the shell at login time). 当前使⽤的shell(通常在登录时由shell设置)。 TERM Specifies terminal type, used by more to get the terminal characteristics necessary to manipulate the screen. 指定终端类型,更多地⽤于获取操作屏幕所需的终端特征。 VISUAL Editor the user is preferring. Used when key command v is pressed. ⽤户更喜欢的编辑器。在按下键命令v时使⽤。 EDITOR Editor of choise when VISUAL is not specified. 当VISUAL环境变量没有被指定时,使⽤choise编辑器。1、逐页显⽰ ⽂档内容,如有连续两⾏以上空⽩⾏则以⼀⾏空⽩⾏显⽰。[root@peipei3514 usr]# more -s 1 2018-03-02 12:39:06:698 YZXBB2 2018-03-03 12:40:16:700 VGLHY3 2018-03-04 12:41:17:701 XANRN 4 2018-03-05 12:42:22:701 RXNYJ5 2018-03-06 12:43:14:701 BBUEM6 2018-03-07 12:44:14:701 FKYDL7 2018-03-08 12:45:08:701 KAHMA8 2018-03-09 12:46:14:702 GZZXG9 2018-03-10 12:47:16:702 OEVDO10 2018-03-11 12:48:06:702 ALXQQ11 2018-03-12 12:49:10:702 HOCSQ--More--(5%)2、从第 20 ⾏开始显⽰ testfile 之⽂档内容。[root@peipei3514 usr]# more +20 220 2018-10-07 19:09:36:781 DJAOD221 2018-10-08 19:10:31:781 TBYYK222 2018-10-09 19:11:30:781 LYYPT223 2018-10-10 19:12:37:781 AXVWT224 2018-10-11 19:13:33:781 UXSGR225 2018-10-12 19:14:34:781 TBMJP226 2018-10-13 19:15:33:781 IMNNK227 2018-10-14 19:16:23:781 LHEGY228 2018-10-15 19:17:37:782 YMZPO--More--(14%)3、从⽂件中查找第⼀个出现"ZCJ"字符串的⾏,并从该处前两⾏开始显⽰输出[root@peipei3514 usr]# more +/ZCJ ...跳过203 2018-09-20 18:52:37:779 UZDCE204 2018-09-21 18:53:40:779 NCISH205 2018-09-22 18:54:34:779 ZCJUY206 2018-09-23 18:55:38:779 SEJKZ207 2018-09-24 18:56:27:779 CNGMW208 2018-09-25 18:57:31:779 GLILU209 2018-09-26 18:58:24:779 VWUSO210 2018-09-27 18:59:39:779 HDRAT211 2018-09-28 19:00:40:779 CFGHE212 2018-09-29 19:01:41:780 VHLIB213 2018-09-30 19:02:34:780 NMJPE214 2018-10-01 19:03:29:780 CJWWI215 2018-10-02 19:04:40:780 HISAY--More--(7%)4、设定每屏显⽰⾏数[root@peipei3514 usr]# more -5 201 2018-09-18 18:50:25:778 ZHWKD202 2018-09-19 18:51:26:778 VQGRP203 2018-09-20 18:52:37:779 UZDCE204 2018-09-21 18:53:40:779 NCISH205 2018-09-22 18:54:34:779 ZCJUY--More--(2%)说明:最下⾯显⽰了该屏展⽰的内容占⽂件总⾏数的⽐例,按 Ctrl+F 或者 空格键 将会显⽰下⼀屏5条内容,百分⽐也会跟着变化。5、列⼀个⽬录下的⽂件,由于内容太多,我们应该学会⽤more来分页显⽰。这得和管道 | 结合起来 。[root@peipei3514 usr]# ls -l| more -5总⽤量 116dr-xr-xr-x. 2 root root 20480 12⽉ 29 15:20 bindrwxr-xr-x. 2 root root 6 11⽉ 5 2016 etcdrwxr-xr-x. 2 root root 6 11⽉ 5 2016 gamesdrwxr-xr-x. 3 root root 23 12⽉ 23 23:12 include--More--6、显⽰⽂件接下来的 5 ⾏先按数字键5,再按空格键。
发布评论