Linux Command Summary --less command

less command Detailed

less is a Linux command-line utility that is used to display the contents of a file or command output, which displays only a page. It is similar to more, but with more advanced features, allowing you to guide forward and backward in a file

Air China. The less command is used to open large files. less will not read the entire file, such as compared to vim or nano text editor, load times will be faster.

grammar  

The general syntax less command is as follows:

less [OPTIONS] filename

parameter 

-b <buffer size> set the buffer size
-e When the file appears after the auto leave
-f to force open a special file, such as a peripheral device code, binary files and directories
-g flag only last keyword search
-i Ignore case when searching
-m command to display more similar percentage
-N display line numbers for each line
-o <filename> content less output is saved in the specified file up
-Q not use warning tones
continuously empty display behavior -s line
-S line too long to give up excess
-x <number> the "tab" key to display the digital space is defined
/ string: down "character string" function
string:? search up "string" function
n: repeating a search before (and / or related?)
N: a search (and / or related?) before the inverted repeat
with b, a rearward
d half-page backward
h displays help screen
Q less command exit
half-page scrolling forward u
y previous row rolling
spacebar to scroll one line
Return to scroll a
[pagedown]: scroll down a
[pageup]: a flip up

Example:

 

Examples

 

1, View Files

 

less log2013.log

 

2, ps to view and process information displayed by the less pager

 

ps -ef |less

 

3, using the View command history is recorded and displayed through the less pager

 

[root@localhost test]# history | less 22 scp -r tomcat6.0.32 root@192.168.120.203:/opt/soft 23 cd .. 24 scp -r web root@192.168.120.203:/opt/ 25 cd soft 26 ls ……省略……

 

4, exploring multiple files

 

less log2013.log log2014.log

 

Description:
Input: n, switching to log2014.log
Input: p, switching to log2013.log

 

Guess you like

Origin www.cnblogs.com/hanjiali/p/11724032.html