1. tail -f
Use when:
- You want to quickly stream a log file.
- You want to perform short, one-off checks on a single log file.
Availibility: available on all Linux/Unix systems.
Example:
tail -f /var/log/syslog2. tail -F
Some services (like Nginx, Apache) rotate logs i.e. they stop writing logs to an old file and instead write to a new file (named sequentially).
tail -f stops following when that happens, but tail -F automatically switches to the new file. In other words, it handles log rotation gracefully.
Use it when: You’re monitoring logs that rotate or get recreated frequently.
Availibility: available on all Linux/Unix systems.
Example:
tail -F /var/log/nginx/access.log3. less +F
This is my favourite & I use it frequently. Think of this as “tail with superpowers.” It gives you the ability to pause streaming & then scroll or search.
It starts in follow mode (like tail -f). But you can stop streaming/following with Ctrl + C. Then you can scroll up, inspect old logs or search for a particular string in the log. You can use Shift + F to resume live view (follow mode).
Use when:
- You want live log view with the ability to pause, scroll, or search inside the log file.
- You’re investigating patterns or specific errors in long logs.
Availibility: available on all Linux/Unix systems.
Example:
less +F /var/log/nginx/error.log4. multitail
If you handle multiple log files, multitail makes life easier.
It splits your terminal and shows all the files updating side by side, with color highlighting.
Availibility: needs to be installed via package manager.
sudo apt install multitail
multitail /var/log/nginx/access.log /var/log/nginx/error.logUse it when: You need to inspect multiple logs and need everything on one screen.
In Short
| Command | Best For |
|---|---|
tail -f | Simple one-file follow |
tail -F | Handles log rotation |
less +F | Scroll, search, follow |
multitail | Watch multiple logs |
Logs are raw, unfiltered, and brutally honest. Like that one friend who tells you the truth even when it stings. That’s exactly what makes them so useful when you’re trying to figure out what your system/service is really going through.
Thanks for reading all the way till here :)
Happy live logging!
