Categories
apache linux OS programming Quick Tips servers

Using the UNIX tail -f command to watch log files

When troubleshooting a problem in Apache it is a pain to open the log file, find an error, close the log file, and then open it again after you perform some action. This is why ‘tail’ is so handy.

Simply use the command below to view the last 100 lines of a log file, and as new entries are added to the file they are automatically displayed on the screen.

tail -f /the/file/name -n -100