views:

40

answers:

5

Quick question, hopefully... I'm building an application with a fairly extensive log file. I'd like the ability at any time to monitor what a specific instance of my application is doing. I could open and close the log file a bunch of times, but its kind of a pain. Optimally, as lines are written to the log file, they would be written to the console as well. So I'm hoping something along the lines of "cat" exists that will actually block and wait for more content to be available in the input file. Anyone have any ideas?

+3  A: 
tail -f logfile

this will keep it open and 'follow' the new output.

Fosco
+2  A: 
tail -f yourlogfile
Alberto Zaccagni
+1 Thanks, but I can only give one correct answer :(
LorenVS
Not a problem! ;)
Alberto Zaccagni
+2  A: 

tail -f logfile

R Samuel Klatchko
+1 Thanks, but I can only give one correct answer
LorenVS
A: 

Look at tee utility

http://www.devdaily.com/blog/post/linux-unix/use-unix-linux-tee-command-send-output-two-or-more-directions-a

Miro A.
Not what the OP wants.
Dennis Williamson
+2  A: 

An alternate answer for variety: If you're already looking at the log file with less, press capital F to get it to do the same thing tail -f does: wait for new content to be appended and show it.

Marius Gedminas