转;

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

Linux常用基本命令(less)

LESS:跟more命令的功能类似,都是用于分页显示内容,但是他的性能比more更高,功能比more更丰富,他读取文件是按需加载

格式:

less [option] [file]

-N : 显示每行的行号 类似cat命令的-n

-s: 将连续的空行显示为一行

交互子命令:

b: 向前翻一页

空格键:向后翻一页

u:向前翻半屏

d:向后翻半屏

y:向上滚动一行

回车键:向下滚动一行

/字符串 向下搜索字符串

?字符串 向上搜索字符串

n 向后查找下一个匹配的文本

N 向前查找前一个匹配的文本 

G:移动到最后一行 

g:移动到第一行

h:显示帮助页面

q:退出less命令

 

ghostwu@dev:~/linux/more$ ls /etc | less -N

 

在交互模式下,用h显示帮助页面,可以查看less命令详细用法

Linux常用基本命令(less),Linux常用基本命令(less) 随笔 第1张
1 
      2 SUMMARY OF LESS COMMANDS 3 4 Commands marked with * may be preceded by a number, N. 5 Notes in parentheses indicate the behavior if N is given. 6 A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl- 6 K. 7 8 h H Display this help. 9 q :q Q :Q ZZ Exit. 10 ----------------------------------------------------------------------- 10 ---- 11 12 MOVING 13 14 e ^E j ^N CR * Forward one line (or N lines). 15 y ^Y k ^K ^P * Backward one line (or N lines). 16 f ^F ^V SPACE * Forward one window (or N lines). 17 b ^B ESC-v * Backward one window (or N lines). 18 z * Forward one window (and set window to N). 19 w * Backward one window (and set window to N)
Linux常用基本命令(less),Linux常用基本命令(less) 随笔 第2张

 

作者:ghostwu, 出处: http://www.cnblogs.com/ghostwu 博客大多数文章均属原创,欢迎转载,且在文章页面明显位置给出原文连接 分类: linux运维与应用软件,

LESS:跟more命令的功能类似,都是用于分页显示内容,但是他的性能比more更高,功能比more更丰富,他读取文件是按需加载

格式:

less [option] [file]

-N : 显示每行的行号 类似cat命令的-n

-s: 将连续的空行显示为一行

交互子命令:

b: 向前翻一页

空格键:向后翻一页

u:向前翻半屏

d:向后翻半屏

y:向上滚动一行

回车键:向下滚动一行

/字符串 向下搜索字符串

?字符串 向上搜索字符串

n 向后查找下一个匹配的文本

N 向前查找前一个匹配的文本 

G:移动到最后一行 

g:移动到第一行

h:显示帮助页面

q:退出less命令

 

ghostwu@dev:~/linux/more$ ls /etc | less -N

 

在交互模式下,用h显示帮助页面,可以查看less命令详细用法

Linux常用基本命令(less),Linux常用基本命令(less) 随笔 第3张
1 
      2 SUMMARY OF LESS COMMANDS 3 4 Commands marked with * may be preceded by a number, N. 5 Notes in parentheses indicate the behavior if N is given. 6 A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl- 6 K. 7 8 h H Display this help. 9 q :q Q :Q ZZ Exit. 10 ----------------------------------------------------------------------- 10 ---- 11 12 MOVING 13 14 e ^E j ^N CR * Forward one line (or N lines). 15 y ^Y k ^K ^P * Backward one line (or N lines). 16 f ^F ^V SPACE * Forward one window (or N lines). 17 b ^B ESC-v * Backward one window (or N lines). 18 z * Forward one window (and set window to N). 19 w * Backward one window (and set window to N)
Linux常用基本命令(less),Linux常用基本命令(less) 随笔 第4张

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄