How to monitor a text file in realtime

pbreault picture pbreault · Aug 20, 2008 · Viewed 97.5k times · Source

For debugging purposes in a somewhat closed system, I have to output text to a file.

Does anyone know of a tool that runs on windows (console based or not) that detects changes to a file and outputs them in real-time?

Answer

Mike Schall picture Mike Schall · Sep 2, 2008

I like tools that will perform more than one task, Notepad++ is a great notepad replacement and has a Document Monitor plugin (installs with standard msi) that works great. It also is portable so you can have it on a thumb drive for use anywhere.

For a command line option, PowerShell (which is really a new command line) has a great feature already mentioned.

Get-Content someFile.txt -wait

But you can also filter at the command line using a regular expression

Get-Content web.log -wait | where { $_ -match "ERROR" }