Follow a log file live

Watch a log as it is being written, with and without systemd.

SNP 029 #269 Filed cmd linux

shell
tail -f /var/log/nginx/error.log

-F instead of -f keeps following after logrotate swaps the file out under you.

For services that log to the journal:

shell
journalctl -fu nginx

-f follows, -u picks the unit. Add -n 100 to start with the last 100 lines, or --since "10 min ago".