Skip to content

Instantly share code, notes, and snippets.

@max-mapper
Forked from jlord/readme.md
Last active August 29, 2015 14:07
Show Gist options
  • Save max-mapper/7988d988be265cf199b2 to your computer and use it in GitHub Desktop.
Save max-mapper/7988d988be265cf199b2 to your computer and use it in GitHub Desktop.

less commands

  • open a file: less file.log
  • type capital G: go to end of file
  • type small g: go to beginning of file
  • type ?: enter reverse search
  • type /: enter forward search
  • type n: skips to next search match
  • type N: skips back to last search match

e.g.

g
/

will go to beginning of file and enter a forward search

g
/error
<enter>

will go to beginning of file and find the first instance of 'error' and take you there

hit n to skip to the next search match

you can also do:

G
?error
<enter>

to go to end of file and search backwards

@klynton
Copy link

klynton commented Oct 12, 2014

Also add in 'v' to drop into $EDITOR to edit the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment