Is there a command/program for OS X that allows me to hook to a file and display its changes in realtime without re-opening it, much like "top" monitors system processes in realtime ?

Thank you

link|improve this question
feedback

3 Answers

up vote 3 down vote accepted

You can use tail -f to monitor single log file

link|improve this answer
It doesn't seem to display changes as the file updates – Mark F Feb 6 '11 at 18:38
It does, at least on FreeBSD and linuxes. Should work on Mac OS X too. – gelraen Feb 6 '11 at 18:41
@Mark how do you modify the file during checking? – ulidtko Feb 6 '11 at 18:48
Perhaps it has something to do with the fact that the file is in a Dropbox and is updated perhaps a bit differently? – Mark F Feb 6 '11 at 18:48
It does work on OS X. On my systems anyway. – SvenW Feb 6 '11 at 18:50
show 4 more comments
feedback

Another alternative may be doing less the-interesting-file and hitting Shift+F.

link|improve this answer
Or less +F logfile – Dennis Williamson Feb 6 '11 at 19:51
feedback

If you are doing this on file sync'd by dropbox the chances are it is creating a new file with a different inode so the tail -f command and the less +F command do not work since they are still referencing the old file handle they opened initially.

I suggest trying

watch "tail /path/to/filename"

It feels hackish but at least every X seconds it will re run tail on the filename giving you the updated output regardless of whether or not the inodes change on the file.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.