more命令,功能类似 cat ,cat命令是整个文件的内容从上到下显示在屏幕上。 more会以一页一页的显示方便使用者逐页阅读,而最基本的指令就是按空白键(space)就往下一页显示,按 b 键就会往回(back)一页显示,而且还有搜寻字串的功能 。more命令从前向后读取文件,因此在启动时就加载整个文件。

1.命令格式:

more [-dlfpcsu ] [-num ] [+/ pattern] [+ linenum] [file ... ]

2.命令功能:

more命令和cat的功能一样都是查看文件里的内容,但有所不同的是more可以按页来查看文件的内容,还支持直接跳转行等功能。

3.命令参数:

+n      从笫n行开始显示

-n       定义屏幕大小为n行

+/pattern 在每个档案显示前搜寻该字串(pattern),然后从该字串前两行之后开始显示

-c       从顶部清屏,然后显示

-d       提示“Press space to continue,’q’ to quit(按空格键继续,按q键退出)”,禁用响铃功能

-l        忽略Ctrl+l(换页)字符

-p       通过清除窗口而不是滚屏来对文件进行换页,与-c选项相似

-s       把连续的多个空行显示为一行

-u       把文件内容中的下画线去掉

4.常用操作命令:

Enter    向下n行,需要定义。默认为1行

Ctrl+F   向下滚动一屏

空格键  向下滚动一屏

Ctrl+B  返回上一屏

=       输出当前行的行号

:f     输出文件名和当前行的行号

V      调用vi编辑器

!命令   调用Shell,并执行命令

q       退出more

5.命令实例:

实例1:显示文件中从第3行起的内容

命令:

more +3 log2012.log

实例2:从文件中查找第一个出现"day3"字符串的行,并从该处前两行开始显示输出

命令:

more +/day3 log2012.log

实例3:设定每屏显示行数

more -5 log2012.log

说明:

最下面显示了该屏展示的内容占文件总行数的比例,按 Ctrl+F 或者 空格键 将会显示下一屏5条内容,百分比也会跟着变化。

实例4:列一个目录下的文件,由于内容太多,我们应该学会用more来分页显示。这得和管道 | 结合起来

命令:

ls -l  | more -5

说明:

每页显示5个文件信息,按 Ctrl+F 或者 空格键 将会显示下5条文件信息。

linux 'more' command.的更多相关文章

  1. Linux:-bash: ***: command not found

    Linux:-bash: ***: command not found,系统很多命令都用不了,均提示没有此命令. 突然之间linux很多命令都用不了,均提示没有此命令. 这应该是系统环境变量出现了问题 ...

  2. 12 Linux Which Command, Whatis Command, Whereis Command Examples

    This Linux tutorial will explain the three "W" commands. The three "W"s are what ...

  3. 【Linux】-NO.8.Linux.4.Command.1.001-【Common Command】-

    1.0.0 Summary Tittle:[Linux]-NO.8.Linux.4.Command.1.001-[Common Command]- Style:Linux Series:Command ...

  4. learn Linux sed command

    learn Linux sed command 一.参考文档: . sed命令详解 http://qifuguang.me/2015/09/21/sed%E5%91%BD%E4%BB%A4%E8%AF ...

  5. Linux cp command All In One

    Linux cp command All In One $ man cp $ cp -h # 强制 $ cp -f # 递归,复制文件夹 $ cp -r demos cp -fr # ./folder ...

  6. how to using Linux pipe command output another command's help content to a file

    how to using Linux pipe command output another command's help content to a file Linux tee > >& ...

  7. Changing the Color of Linux ls Command 改变Linux的ls命令显示的颜色

    Linux command ls basically use the file /etc/DIR_COLORS or /etc/DIR_COLORS.xterm to define the color ...

  8. linux net command /uboot command

    1. uboot command 读取寄存器内容 md [内存地址][长度] 修改内存地址 mw [内存地址][长度] 2. linux络命令  -- netstat -a (all)显示所有选项,默 ...

  9. Linux / Unix Command: bunzip2--reference

    http://linux.about.com/library/cmd/blcmdl1_bunzip2.htm NAME bzip2, bunzip2 - a block-sorting file co ...

  10. 10 Linux DIG Command Examples for DNS Lookup--reference

    by RAMESH NATARAJAN on FEBRUARY 29, 2012 http://www.thegeekstuff.com/2012/02/dig-command-examples/ D ...

随机推荐

  1. 初始化rails上的compass项目

    compass以外还有一个很实用的scss模块, _media-queries.scss 通过终端下载 curl -O https://raw.github.com/paranoida/sass-me ...

  2. Cylinder

    http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2374 思路:三分枚举. #include &l ...

  3. IAR FOR ARM 7.2.2破解方法

    直接上图,注意选择"NO" 工具下载地址: http://download.csdn.net/detail/lan120576664/7604593 其实发现,该注册工具连IAR ...

  4. 【HDOJ】2405 Marbles in Three Baskets

    BFS+状态压缩. /* 2405 */ #include <iostream> #include <queue> #include <cstdio> #inclu ...

  5. c++实现委托

    #include "stdafx.h" #include <iostream> #include <string> using namespace std; ...

  6. App自动更新之通知栏下载

    见证过博客园的多次升级,你也希望你的软件通过更新发布新特性通知用户吧,是的.这篇文章是android开发人员的必备知识,是我特别为大家整理和总结的,不求完美,但是有用. 1.设计思路,使用Versio ...

  7. vtk 中文显示

    参考文章: http://www.vislab.cn/bbs/viewthread.php?tid=5079&page=1&extra=#pid19477 http://tieba.b ...

  8. HOWTO:保存nohup日志

    默认情况下,nohup的日志将保存在一个名为nohup.out的文件中.随着时间的推移,nohup.out文件会变得越来越大,直到某一天程序莫名的崩溃.这种情况是可以预防的,有很多策略都可以解决这个问 ...

  9. Double与BigDecimal 比较

    1] 精确的浮点运算: 在Java里面,有时候为了保证数值的准确性需要精确的数据,先提供一个例子就可以发现问题了: public class FloatNumberTester { public st ...

  10. Log4j自定义Appender介绍

    转自:http://gemantic.iteye.com/blog/1234996 最初想要在执行一段业务逻辑的时候调用一个外部接口记录审计信息,一直找不到一个比较优雅的方式,经过讨论觉得log4j自 ...