欢迎访问linux宝典,请记住本站唯一域名:www.linuxbaodian.com

more命令

来源:原创    更新时间:2018-08-26 00:34:25    作者:管理员    浏览:2155
  • 命令描述
more命令是一个基于vi编辑器文本过滤器,它以全屏幕的方式按页显示文本文件的内容,支持vi中的关键字定位操作。more名单中内置了若干快捷键,常用的有H(获得帮助信息),Enter(向下翻滚一行),空格(向下滚动一屏),Q(退出命令)。

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

按Space键:显示文本的下一屏内容。
按Enier键:只显示文本的下一行内容。
按斜线符|:接着输入一个模式,可以在文本中寻找下一个相匹配的模式。
按H键:显示帮助屏,该屏上有相关的帮助信息。
按B键:显示上一屏内容。
按Q键:退出rnore命令。
  • 命令语法
more [选项] [参数]
  • 命令选项
-<数字>:指定每屏显示的行数;
-d:显示“[press space to continue,'q' to quit.]”和“[Press 'h' for instructions]”;
-c:不进行滚屏操作。每次刷新这个屏幕;
-s:将多个空行压缩成一行显示;
-u:禁止下划线;
+<数字>:从指定数字的行开始显示。
  • 命令参数
文件
  • 命令实例

实例1:more 查看文件

[root@linuxbaodian files]# more 01.txt 
She had been shopping with her Mom in Wal-Mart. 
She must have been 6 years old, this beautiful brown haired, freckle-faced image of innocence. 
What? Mom asked.Let's run through the rain! She repeated.
No, honey. We'll wait until it slows down a bit. Mom replied.
Don't you remember? When you were talking to Daddy about his cancer, you said, If God can get us through this, he can get us through anything!

This young child waited about another minute and repeated: "Mom, let's run through the rain."

We'll get soaked if we do. Mom said.

No, we won't, Mom. That's not what you said this morning, the young girl said as she tugged at her Mom's arm."

实例2:  查看文件前先清屏

[root@linuxbaodian files]# more -c 10 01.txt 
10: No such file or directory--More--(Next file: 01.txt)
She had been shopping with her Mom in Wal-Mart. 
She must have been 6 years old, this beautiful brown haired, freckle-faced image of innocence. 
What? Mom asked.Let's run through the rain! She repeated.
No, honey. We'll wait until it slows down a bit. Mom replied.
Don't you remember? When you were talking to Daddy about his cancer, you said, If God can get us through this, he can get us through anything!

This young child waited about another minute and repeated: "Mom, let's run through the rain."
She must have been 6 years old, this beautiful brown haired, freckle-faced image of innocence. 
What? Mom asked.Let's run through the rain! She repeated.
No, honey. We'll wait until it slows down a bit. Mom replied.
Don't you remember? When you were talking to Daddy about his cancer, you said, If God can get us through this, he can get us through anything!

This young child waited about another minute and repeated: "Mom, let's run through the rain."

We'll get soaked if we do. Mom said.

No, we won't, Mom. That's not what you said this morning, the young girl said as she tugged at her Mom's arm."

 

上一条命令:head

下一条命令:tee

笔记分享

表情

共0条分享记录
  • 这篇文章还没有收到评论,赶紧来抢沙发吧~

相关内容

最受欢迎

猜你喜欢

最受争议