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 ...
随机推荐
- 利用多线程资源竞争技术上传shell
通过多线程资源竞争的手段同时上传两个头像,就可以在Apache+Rails环境下实现远程代码执行.这并不是天方夜谭,同时我相信许多文件上传系统都会有这个漏洞……这是一个非常有趣的安全实验,一起来看看吧 ...
- Linux Shell脚本Ldd命令原理及使用方法
1.首先ldd不是一个可执行程序,而只是一个shell脚本2.ldd能够显示可执行模块的dependency,其原理是通过设置一系列的环境变量如下:LD_TRACE_LOADED_OBJECTS.LD ...
- If one session has a shared or exclusive lock on record R in an index, another session cannot insert
If one session has a shared or exclusive lock on record R in an index, another session cannot insert ...
- C参数计算
C‘计算参数时,从右向左压栈的 int a[]={1,3,4}; int * ptr=a; pirntf("%d,%d\n",*ptr,*(++ptr)); 输出都是3:
- COJ 0970 WZJ的数据结构(负三十)树分治
WZJ的数据结构(负三十) 难度级别:D: 运行时间限制:1000ms: 运行空间限制:262144KB: 代码长度限制:2000000B 试题描述 给你一棵N个点的无根树,点和边上均有权值.请你设计 ...
- matlab中如何求某一个矩阵的标准差和均值
方法: 先reshape成行向量或者列向量 然后,利用mean函数,std函数. 构造测试数据,可以利用random函数,就好.利用这个函数,可以构造不同分布的随机数列(或 矩阵). 如: >& ...
- 网络流(最大流) HDU 1565 方格取数(1) HDU 1569 方格取数(2)
HDU 1565 方格取数(1) 给你一个n*n的格子的棋盘,每个格子里面有一个非负数.从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数的 ...
- CTE Recursion Performance
CTE全名是Common Table Expression,语法基础请参考MSDN文档:https://msdn.microsoft.com/zh-cn/library/ms175972.aspx. ...
- ./filezilla: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory
opensuse系统 在filezilla官网下载压缩文件解压运行后报 ./filezilla: error while loading shared libraries: libpng12.so.0 ...
- RabbitMQ和kafka从几个角度简单的对比--转
业界对于消息的传递有多种方案和产品,本文就比较有代表性的两个MQ(rabbitMQ,kafka)进行阐述和做简单的对比, 在应用场景方面, RabbitMQ,遵循AMQP协议,由内在高并发的erlan ...