Common operation commands: (commands to use when you open a file with less)
/keyword search down "keywords"
keyword search up "keywords"
& Keywords only show lines with "keywords"
n Repeat last search (with/and?) Related to use)
N Repeat the previous search, showing the reverse order of n (with/and?). Related to use)
u turn up half page
b turn up one page
d turn down half a page
space down one page
g go to the first line
G go to the last line
↑ Scroll up one line
↓ Scroll down one line
v Open VI Editor
Common examples:
Example one: Using less to view a file
Command: less file
Example two: View the command input history and display it with less paging
Command: History | Less
Example three: viewing multiple files simultaneously, such as File1, File2, File3
Command: less file1 file2 file3
Note: When viewing multiple files at the same time, you need to switch the file, in the less display page from the previous file switch to the next file input ": N", switch from the current file to the previous file input ": P"
Example four: Use the less command to view and modify file files
Command: less file in input v
Note: When you use less to view a file, you need to modify to enter "v" in the less display page, switch vi Editor to edit and modify
Example five: Display only lines with the keyword "Zhe" in the file files
Command: less file enter & keyword
Note: When using the less command to view a file, if you want to display only the line of a keyword, just use less to open the file, enter "& keyword " in it
Example six: Using the less command to view large files can also be used to mark the location of the current check to see, to facilitate reading
Command: less file enter mafter entering, then enter the name you want to edit such as "a"
Description: When you view a file with the less command, use the command "m", add a tag, enter "m", and then enter a name to mark, such as "a", and when you want to view the marker position again, enter "a "to return to this tag, and to mark multiple places of the file, just mark the tag with the same name.