Follow a Log File Live with tail -f
Stream new log lines as they appear — the classic way to debug services on Linux.
01Command
$ tail -f /var/log/syslog02What it does
tail -f starts at the end of the file and keeps printing lines as they are appended, so you can watch what a service writes in real time. Add -n 50 to start with more context, or use tail -F (capital F) when the log is rotated, because it reopens the file by name after rotation. Combine with grep, e.g. tail -f /var/log/syslog | grep --line-buffered sshd, to filter live output.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- tail(1) — Ubuntu manpageEvidence: Ubuntu manpage describes --follow (-f) and -F, which follows the file by name and handles rotation
- tail(1) — man7.orgEvidence: Man page documents tail's -f option to follow a file as it grows and -n to select the number of lines
Last verified: 2026-09-19 · Category: Files & Folders
06Related solutions
One command that prints every interface with its state and IPv4/IPv6 addresses in a short table — the modern, memorable replacement for digging through `ifconfig` or the verbose `ip addr` output.
The routing table is the first thing to check when traffic leaves the wrong interface or the gateway seems dead — and `ip route show` is the quick, modern way to read it.
The fastest way to answer 'is the firewall blocking me?' — netcat in scan mode attempts one TCP connection and prints whether it succeeded.