tail -f on Windows

Is there an equivalent of Unix tail -f in Windows 2000

See tips 6705 and 4574 in the ‘Tips & Tricks’ at http://www.jsiinc.com

Q. How can I count the number of lines in a file, and/or display the last n lines?
A. I have scripted Tail.bat to perform both functions.

The syntax is:

tail FileName [NumberOfLinesToDisplay]

If NumberOfLinesToDisplay is 0, you can set the file line count by using:

for /f %%i in ('tail FileName 0') do set lines=%%i

If NumberOfLinesToDisplay is omitted, 10 lines will be displayed.

If NumberOfLinesToDisplay is greater than the lines in the file, all lines in the file will be displayed.

Tail.bat contains:

@echo off
if {%1}=={} @echo FileName parameter requied.&goto :EOF
if not exist %1 @echo %1 does NOT exist.&goto :EOF
set file=%1
set /a number=10
if not {%2}=={} set /a number=%2
for /f %%i in ('find /v /c "" ^


If you are running Windows XP or higher download Windows Server 2003 Resource Kit Tools.


If you dont like or cant use any of above download baretail.exe (only 186k) from WinTail