Wall-Skills.com

Spread Knowledge with 1-Pagers – Agile & Scrum, Product Management, Facilitation, DevOps

less +F for viewing logs

Brian Storti wants you to stop using tail -f (mostly). He laid out his points so compellingly that we want to help spread the message with something readily printable. Enjoy 🙂

Are you a budding Product Owner? Check out our compilation "Skills for Successful Product Owners"

Content of 1-pager:

When you are monitoring a single file, consider using less +F over tail -f. At first they do the same thing, but less +F allows you to switch from watch mode into a navigation mode with ctrl-c (and
back to watching with F).

In navigation mode you can use the usual less commands, such as:

  • Search “foo” with /foo
  • Jump to the next occurence with n or the previous with N
  • Go up with j or down with k
  • Create marks with m

If you use rotating logs, check out the –follow-name option.

When you are monitoring multiple files, you’ll probably prefer tail -f because it will show you changes in all monitored files whereas less +F will only show you the first file (unless you use ctrl-c, :n, F to switch between buffers).

Also stick with tail -f if you want to insert empty lines as a visual separation.

Next Post

Previous Post

Leave a Reply

© 2024 Wall-Skills.com

Theme by Anders Norén