Unix Style Tail Command for Windows XP

Posted On 2007-04-05 by dwirch
Tags: General Tip Tutorial Windows XP
Views: 15118

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.

Now that the tail command is available, to see the online help, enter the following DOS command:

tail /?

Here is a command summary:


Display the last ten lines from file FILENAME. For example, to see the last ten activities made by the Windows Update tool, issue these commands:

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

C:\>tail -n FILENAME

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

C:\>cd \windows
C:\>tail -20 setuplog.txt

C:\>tail -f FILENAME

Keep accessing FILENAME, displaying new lines as necessary.

To see this feature in action, open up a new file in Notepad, write the word "hello, world", and save it as c:\test.log. Keep the file open in Notepad. Now, issue the following DOS commands:

C:\>cd \
C:\>tail -f test.log

You should see the word "hello, world" in your DOS prompt. Now, go back to Notepad and write the text "Process executed." Save the file. The DOS prompt should now say "Process executed." Whatever you add to the file in Notepad should then appear in your DOS prompt until you terminate the command.

About the Author

dwirch has posted a total of 190 articles.

Comments On This Post

No comments on this post yet!

Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.

Your IP address is:

Before you can post, you need to prove you are human. If you log in, this test goes away.

Code Links