See appended log lines instantly from the shell and debug in real time. 16.11.2025 | reading time: 2 min Tail with the -f flag is the simplest way to watch new lines appended to a file in real time, ideal for following logs and debugging running services; this lesson shows how to use it and when to reach for stronger tools. Live log demo Create a small log, run tail -f in one shell and append from another to see live updates; try this example: ```bash # terminal A: prepare file and follow $ printf "line1 line2 line3 line4 line5 " > /tmp/app.log $ tail -n 5 -f /tmp/app.log line1 line2 line3 line4 line5 # terminal B: append events $ echo "User login from 10.0.0.5" >> /tmp/app.log $ echo "Error: disk full" >> /tmp/app.log # terminal A (continues): new lines appear immediately User login from 10.0.0.5 Error: disk full ``` Options that matter Don't just run -f and hope: use `-n` to control how many historical lines you see, use `-F` (follow by name and retry) to handle rotated logs, and consider `--pid=PID` to stop following when a process exits; combine tail -f with `grep`, `awk` or `sed` to filter or colorize streams, or run `ssh host "tail -f /var/log/app.log"` to watch a remote file in place. Rotation and follow modes tail can follow by file descriptor (default) which keeps the old inode after rotation, or by name with `--follow=name` so it notices a new file; `-F` equals `--follow=name --retry` and is usually the best choice for log files rotated by logrotate or a service that renames files. Where to go from here Practice by watching real service logs, pipe output into parsing scripts, and experiment with `-F` during rotation; when he wants a certification path, CompTIA Linux+ or LPIC-1 are logical next steps and bitsandbytes.academy offers intensive exam preparation. Join Bits & Bytes Academy First class LINUX exam preparation. utilities filesystem troubleshooting