Copied to clipboard

less

`less` command is used to view the contents of a text file. It allows you to quickly browse and search through a file without loading the entire file into memory.

Examples

  1. View file contents: less filename
  2. Search file contents: Type / followed by the search term and press enter. Use n and N to navigate search results.
  3. Exit less: Press q to exit less.
  4. Scrolling: Use spacebar or Page Down to scroll down and b or Page Up to scroll up.
  5. Display line numbers: Use the N option to display line numbers.
  6. Jump to a specific line: Press g to jump to the beginning of the file, G to jump to the end of the file, or :number to jump to a specific line number.
  7. View multiple files: Use the command less file1 file2 to view multiple files simultaneously.