linux_wiki:less

Less

General Information

Less is a pager utility with more capabilities than the 'more' utility.


Less Environmental Vars

less can be customized with env vars added to bashrc.

~/.bashrc
 
LESS='-C -M -I -j 10'
  • -C – Make full-screen reprints faster by not scrolling from the bottom.
  • -M – Show more information from the last (status) line.
  • -I – Ignore letter case in searches.
  • -j 10 – Show search results in line 10 of the terminal, instead of the first line. Gives more context for results.

Usage

With a file open in less (eg: less /var/log/messages), you press:

  • F
    • Starts following the file as if you did tail -f /var/log/messages. Stop following press ctrl+c.
    • An advantage over tail -f, is that if you have a search result highlighted before typing F, as lines are appending to the file, new words that match your search are highlighted.

  • linux_wiki/less.txt
  • Last modified: 2019/11/04 21:53
  • by billdozor