The less tool is a tool for paging through files or other output and is a powerful tool for Linux to view the contents of a file. Supports search up and down.
1. Command format
Less [parameter] file
2. Command function
Less and more are similar, with less you can browse files at will, and more can only move forward and not move backwards. And less is not going home before viewing the entire file.
3. Command parameters
-B < buffer size > Set buffer size
-e automatically leaves the current file after the display finishes
-F Force open special file, eg peripheral device code, directory, binary file
-G only flags the last keyword searched
-I ignores case when searching
-m shows a percentage similar to the more command
-N Displays the line number of each line
-o < file name > save less output in the development file
-Q does not use warning tones
-S displays a row of continuous empty behavior
-S line over a long time will be over partially discarded
-X < number > Displays the "tab" key as a specified number space
/string: Search down the function of "string"
String: The ability to search up "string"
N: Repeat the previous search (with/or?). About
N: Reverse repeats the previous search (and/or?) About
b Turn back one page
D Turn back half a page
H Display Help interface
Q Exit less command
U scroll forward Half page
Y Scrolls forward one line
SPACEBAR Scrolls one line
Enter key to scroll one page
[PageDown]: Flip one PAGE Down
[PageUp]: Flip one page Up
4. Additional Notes
CTRL f/b Move one screen forward/back
CTRL d/u move half screen forward/rear
J/k move forward/backward one line
G move to last line
G Move to First line
Q/zz Exit less command
V Edit the current file using the configured editor
H Show help documentation for less
&pattern displays only the lines of the matching pattern, not the entire file
When you use less to view large files, you can mark them in any one place, and you can navigate to the text location labeled with a specific tag by command:
Ma use A to mark the current position of the text
' A navigate to mark a
linux-less command