Following log files and other output

In many situations, especially when testing, I like to see the log file content (or other system output) on one of my open command line windows.

Most of the time

tail -f <log-file-name>

is just fine. However, sometimes I like to have more control of what displayed. In these cases, I use less (https://en.wikipedia.org/wiki/Less_(Unix)):

less +F <log-file-name>

is more convenient (and powerful): I can navigate the whole file, search for specific content.

Note, that while tail uses a lower-case ‘-f’ to follow the file as it’s being written to, less uses an uppercase ‘+F’.

Update (2022-02-04): Fixed it: less uses ‘+F’ (plus upper-case F) as the command line argument, not ‘-F’.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Seaside Testing

Subscribe now to keep reading and get access to the full archive.

Continue reading