Friday, June 4, 2010

Tech Notes--Using Tail..

I found this command very handy in numerous occasions both in Unix/Linux and Windows.Tail command is used mainly for monitoring logs, especially real time monitoring.In unix/linux, its as easy as opening a shell and typing

tail -f .
Example:- tail -f /var/log/message

It will start displaying you the system log messages on screen with details, like time, machine name, process related info or warning or message.This will continuously display messages.To stop it we can use "Ctlr + c"

There is a windows equivalent. This is not part of OS. You need to install "Windows Server 2003 Resource Kit Tools"

1. Go to the Microsoft Windows Server 2003 download section at Or, if that link does not work, visit and search for "Windows 2003". Once there, choose the "Downloads -> Tools" link.

2. Select the link "Windows Server 2003 Resource Kit Tools".

3. Click the "Download" link.Follow the instructions to download and install the product. The default install directory is "C:\Program Files\Windows Resource Kits\Tools\".

Once the Windows 2003 Resource Kit is installed, you may need to reboot your machine for the directory "C:\Program Files\Windows Resource Kits\Tools\" to be added to your path.

I found this command useful to tail IIS logs real time to check traffic and troubleshoot connectivity issues from remote host.

To get help regarding the command enter the following
tail /?

This tool can also be used for different purposes other than real time log monitoring. For example to see the last ten line of windows update log
C:\>cd \windows
C:\>tail -10 "Windows Update.log"

Other options:

C:\>tail -n "Windows Update.log"

Display the last 'n' lines from file Windows Update.log. For example, view the last 20 lines in the Windows Setup log:

C:\>cd \windows
C:\>tail -20
"Windows Update.log"

Post a Comment