linux 'more' command.
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.的更多相关文章
- Linux:-bash: ***: command not found
Linux:-bash: ***: command not found,系统很多命令都用不了,均提示没有此命令. 突然之间linux很多命令都用不了,均提示没有此命令. 这应该是系统环境变量出现了问题 ...
- 12 Linux Which Command, Whatis Command, Whereis Command Examples
This Linux tutorial will explain the three "W" commands. The three "W"s are what ...
- 【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 ...
- learn Linux sed command
learn Linux sed command 一.参考文档: . sed命令详解 http://qifuguang.me/2015/09/21/sed%E5%91%BD%E4%BB%A4%E8%AF ...
- Linux cp command All In One
Linux cp command All In One $ man cp $ cp -h # 强制 $ cp -f # 递归,复制文件夹 $ cp -r demos cp -fr # ./folder ...
- 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 > >& ...
- 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 ...
- linux net command /uboot command
1. uboot command 读取寄存器内容 md [内存地址][长度] 修改内存地址 mw [内存地址][长度] 2. linux络命令 -- netstat -a (all)显示所有选项,默 ...
- Linux / Unix Command: bunzip2--reference
http://linux.about.com/library/cmd/blcmdl1_bunzip2.htm NAME bzip2, bunzip2 - a block-sorting file co ...
- 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 ...
随机推荐
- 董的博客 hadoop
董的博客 https://issues.apache.org/jira/browse/MAPREDUCE 很重要,把MAPREDUCE改为YARN即可 直接下载patch即可 http://horto ...
- Lowest Common Ancestor in Binary Tree
The problem: Given node P and node Q in a binary tree T. Find out the lowest common ancestor of the ...
- vim学习与理解
1. 转变思维 --> vim 无鼠标文本编辑工具 在鸟哥的linux私房菜中,是这么说明linux的: 1. vim是linux like系统中非常强大的一个文本编辑工具,历史悠久,很多系统都 ...
- select的使用(二)
多表查询 /*基本连接*/ select a.Name,b.Name from T_Employee a,T_Department b where a.DepartmentId=b.Id /*内连接, ...
- zoj 1586
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1586 //zoj 1586 #include<iostream> ...
- SPJ
1. ∏sno(δjno='j1'(spj))2. ∏sno(δpno='p1'(δjno='j1'(spj)))3. ∏sno(δjno='j1'(spj)∞δcolor='红'(p))4. ∏jn ...
- Interesting Punch-Bowl(优先队列)
/** http://acm.nyist.net/JudgeOnline/problem.php?pid=547 题意: 有一个正方形的区域 区域上面有高度不同的1*1的立方体自然有凸有凹 凹的地方可 ...
- Spring和Struct整合的三个方法
1.使用Spring 的 ActionSupport .2.使用Spring 的 DelegatingRequestProcessor 类.3.全权委托. 无论用那种方法来整合第一步就是要为strut ...
- 第一节:Scrapy开源框架初探
Scrapy是一个为了爬取网站数据,提取结构性数据而编写的应用框架. 可以应用在包括数据挖掘,信息处理或存储历史数据等一系列的程序中. 具体开发流程如下: 一.确定待抓取网站 当您需要从某 ...
- msyql 字节问题
MySQL 数据库的varchar类型在4.1以下的版本中的最大长度限制为255,其数据范围可以是0~255或1~255(根据不同版本数据库来定).在 MySQL5.0以上的版本中,varchar数据 ...