/etc insider

since 1999 (and still editing)

The less we know

| Comments

We’re often not that eager to know the tools we got used to. less is a good example for that. Did you know(?) it can:

  • show/unshow line numbers: -N
  • select position you want to see using percentage – say, let’s jump to ⅓ (33 %) of the log: 33p
  • chop long line (say “goodbye!” to MySQL’s \G when output is wide and you used pager less): -S
  • squeeze multiple blank lines so you have less pages to deal with: -s
  • Display only (non-)matching lines (say “bye-bye!” to fgrep foo bar | less): &
  • pipe the whole file or a part of it through filter you’ve chosen: |
  • run editor for the file in question: v

Do yourself a favor and just press h when in less – I bet you won’t regret that now you’d know less. ;-)