Unix Manuals

Quick Tips

NOTICE - New forum for all UNIX learners, users and programmers - click here

Following a file with the 'tail -f' command

Many users are aware of the UNIX® command 'tail', which can be used to display the last few lines of a large file. This can be useful for viewing log files, etc.

Even more useful in some situations, is the '-f' parameter to the 'tail' command. This causes tail to 'follow' the output of the file. Initially, the response will be the same as for 'tail' on its own - the last few lines of the file will be displayed. However, the command does not return to the prompt, and instead, continues to 'follow' the file. When additional lines are added to the file, they will be displayed on the terminal. This is very useful for watching log files, or any other file which may be appended over time. Type 'man tail' for more details on this and other tail options.


Recommended Book:

cover

Improve your UNIX skills beyond measure - we strongly recommend this excellent book.
Click the image now for more details, to read reviews, and to buy the book.


Click here for the next Quick Tip

Home