The tail That Never Ends

Just waiting for the next line to arrive
Just waiting for the next line to arrive

tail -n 5 shows the last five lines of a log. The version typed most often in real work is one step further: -f.

Run tail -f app.log and the prompt never comes back. Every new line written to the file arrives on screen as it happens. Right after a deploy, you send one request from the browser and watch, waiting to see whether an error shows up. That screen is probably where engineers spend the longest stretch of any day. Ctrl+C when you are done.

That -f, for follow, traveled well beyond the terminal. docker logs -f, kubectl logs -f: one letter that turns reading into watching, the same idea as tail -f.

tail shows you the end of a file, and it also waits for the lines nobody has written yet.