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 ...
随机推荐
- Java Socket Example
1.服务端:server package com.socket; import java.io.BufferedReader; import java.io.IOException; import j ...
- PPI是什么?如何计算?
PPI,英文全称:pixels per inch,即像素每英寸,也叫像素密度,它是描述在水平的和垂直的方向上,每英寸距离的图像包含的像素(pixel)数目.因此PPI数值越高,即代表显示屏能够以越高的 ...
- Context Switch Definition
A context switch (also sometimes referred to as a process switch or a task switch) is the switching ...
- WordPress Pie Register插件‘wp-login.php’多个跨站脚本漏洞
漏洞名称: WordPress Pie Register插件‘wp-login.php’多个跨站脚本漏洞 CNNVD编号: CNNVD-201307-255 发布时间: 2013-07-31 更新时间 ...
- 【转】Android--广播BroadcastReceiver
原文网址:http://www.cnblogs.com/plokmju/p/android_broadcastreceiver.html 前言 Android四大组件,Activity.Service ...
- 搜索与DP:SLIKAR
Problem: SLIKAR[题目描述]Josip 是个奇怪的画家,他想画一幅由 N*N 个点组成的图, N 是一个 2 的乘方 数(1, 2, 4, 8, 16 等.).每个点要么是黑色的,要么是 ...
- CSS3中text-overflow支持以...代替超出文本
CSS3中text-overflow支持以...代替超出文本. 1.div1:默认状态.超出文本默认显示在div外 2.div2:text-overflow:ellipsis; 使用text-over ...
- 从大学开始学C++到现在的一些感悟
Since I choose this road, I will not regret it. --Mereyct 端午过后的第二天,闲着没事,更新一下博客. 写这个博客的原因是,看到了群里有 ...
- HTML参考手册
New : HTML5 中的新标签. 标签 描述 <!--...--> 定义注释. <!DOCTYPE> 定义文档类型. <a> 定义锚. <abbr> ...
- python 发送邮件例子
想到用python发送邮件 主要是服务器 有时候会产生coredump文件 ,然后因为脚本重启原因,服务器coredump产生后会重启 但是没有主动通知开发人员 想了下可以写个脚本一旦产生cored ...