$ less <filename>
SPACE or CTRL+F |
forward one window |
|---|---|
b or CTRL+B |
backward one window |
d or CTRL+D |
forward half window |
u CTRL+U |
backward half window |
j |
navigate forward by one line |
10j |
10 lines forward. |
k |
navigate backward by one line |
10k |
10 lines backward. |
G |
go to the end of the file |
g |
go to the start of the file |
q or ZZ |
exit the less pager |
/ |
search forward for a pattern |
|---|---|
n |
move forward for the next occurrence. |
N |
move backward for the previous occurrence |
? |
search backward for a pattern |
|---|---|
n |
move backward for the next occurrence. |
N |
move forward for the previous occurrence |
F |
Follow the end of the file as more lines are added, similar to tail -f. |
|---|---|
m<any-lower-letter> |
Mark the current position with the letter the specified lower letter, |
‘<lower-letter> |
go to the marked position marked with the specified lower letter. |
&pattern |
display only the matching lines, not all. |
v |
Open the current file in the default editor. |
CTRL+G or = |
show the current file name along with line, byte, and percentage statistics. |
| h | display help |
| :e filename | While viewing a file with less this command allows you to open/examine a. |
| :n | go to the next file |
| :p | go to the previous file |