Skip to content

Instantly share code, notes, and snippets.

@dreynaud
Forked from glnds/less-cheatsheet.md
Last active June 6, 2020 04:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dreynaud/0870e8aec64c6bf5a280abe27a5fffe4 to your computer and use it in GitHub Desktop.
Save dreynaud/0870e8aec64c6bf5a280abe27a5fffe4 to your computer and use it in GitHub Desktop.
Less Cheatsheet

Using less to navigate log files

Navigation
F follow output
ctrl+c stop following output
z forward one window
w backward one window
G go to the end of file
g go to the start of file
10g go to line 10
q exit
Search
/ search for a pattern forward
? search for a pattern backward
n next match
N previous match
Less frequent
-N display line numbers
-S chop (don't wrap) long lines
ma mark the current position with the letter ‘a’,
‘a go to the marked position ‘a’.
&pattern display only the matching lines, not all.
ctrl+G show the current file name along with line, byte and percentage statistics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment