Detailed explanation of less command
less is similar to the more command, but you can use the page key to view the content of the previous and next pages
-b <buffer size> set the size of the buffer
-e automatically leave when the file display is over
-f force open special files, such as peripheral device codes, directories and binary files
-g only mark the last search keyword
-i ignore Case when searching
-m Display the percentage similar to the more command
-N Display the line number of each line
-o<file name> Save the output of less in the specified file
-Q Do not use warning sound
-s Display continuous empty behavior One line
-S If the line is too long, the excess part will be discarded
-x<number> Display the "tab" key as the specified number space
command internal operations
1 The functions of the buttons are as follows:
b scroll up one screen
f scroll down one screen
space bar scroll down one screen
enter key scroll down one line
↑ scroll up one line
↓ scroll down one line
g jump to the first line
G jump to the last line
h display the help interface
q Exit the less command
-
search forward
/ : Search using a pattern and locate the next matching text
n : Find the next matching text forward
N : Find the previous matching text backward -
search backward
? : Search using a pattern and locate the previous matching text
n : Find the next matching text backward
N : Find the previous matching text forward
2 full screen navigation
ctrl + F :向前移动一屏
ctrl + B :向后移动一屏
ctrl + D :向前移动半屏
ctrl + U :向后移动半屏
3 One-way navigation
j : 向前移动一行
k : 向后移动一行
4 Browse multiple files
方式一,传递多个参数给 less,就能浏览多个文件。
less file1 file2
方式二,正在浏览一个文件时,使用 :e 打开另一个文件。
less file1
:e file2
当打开多个文件时,使用如下命令在多个文件之间切换
:n - 浏览下一个文件
:p - 浏览前一个文件
Copyright statement: This article is an original article of CSDN blogger "Snail", following the CC 4.0 BY-SA copyright agreement, please attach the original source link and this statement for reprinting.
Original link: https://blog.csdn.net/zhoujiyu123/article/details/86082493