Thursday, May 6, 2010

The tale of the tail

If you guys have been using linux then you must have surely come across a command known as "tail" .It is used to display the last few lines of a text file. It is one the best and standard ways of watching or tracking your log files.

When you start a docking or simulation in text mode or in command mode, most of the time the screen goes blank and the cursor does not allow you to enter a new command which essentially means that your job is going on. Now the question is how do you know how much has it progressed. Most of the this program creates a output file or a log file. You could open a new terminal window and cd into that folder and then type the following command :

tail -f logfile.log or tail -f outputfile.out

-f tells the tail to follow the update and hence the latest update gets printed on the screen. By defaul tail prints out the last ten lines but with -f the entire file is monitored as and when the file gets updated.

Pretty useful command...

No comments:

Post a Comment