follow your tail

Shell (~bash) - OS X, Windows, Linux

Riding the coat-tails of yesterday’s head and tail post… is another tail trick.

Just like Toucan Sam never said:

Follow Your Tail

  • Not Toucan Sam

Anyways, tail -f (the f is for follow) follows a file as it is updated.

For example, say your application writes to a log file, and you’d like to watch the log as it gets appended to, without having to constantly hit refresh in your editor. Just pop open a terminal (or bash) and tail -f /path/to/log.txt and watch the log entries start rolling in!

Pretty slick if you ask me. I’ll even do this for unit test runs or builds that I redirect their output to a file. This way the test or build runs faster since it doesn’t have to output to the screen, but I can still watch the output in another terminal or tab window.

Published: June 26 2012

Author: jonfuller