Here are the basic navigation commands you can use with the less command:
- Space: Move forward one page
- b: Move backward one page
- Down Arrow or j: Move down one line
- Up Arrow or k: Move up one line
- g: Go to the beginning of the file
- G: Go to the end of the file
- [number]g: Go to a specific line number (e.g.,
5gto go to line 5) - [number]G: Go to a specific percentage of the file (e.g.,
50Gto go to 50% of the file) - /pattern: Search for a pattern in the file
- ?pattern: Search backward for a pattern
- n: Go to the next search result
- N: Go to the previous search result
These commands will help you navigate efficiently through files in less.
