Monitoring log files with tail
Here’s a useful command for monitoring a log file for changes.
tail -n 0 -f c:/log.txt
The -n flag allows you to specify how many lines you want to output.
The -f flag instructs tail to keep monitoring the files for updates.
Entering the above command into a bash shell will monitor the file c:/log.txt and print out new content to the terminal as the file is modified.
- Updated 17/03/2014: Corrected tail flag descriptions.