A lightweight file pager
Examples
Open a file for paging
less file.txt
Page a command with lots of output
curl example.com | less
Hotkeys
less
hotkeys are similar to those in vim
-
q
- exit less -
j
- up one line -
k
- down one line -
g
- top of file -
G
- bottom of file -
=
- display location in status message -
/pattern<cr>
- search for the pattern in the file- notably, this will not
-
<number><cr>
- go to line at number- you don’t need to press
:
first like invim
- you don’t need to press
-
-N<cr>
- enable line numbers- this also works when passed as a command-line flag