Monitor log files in realtime, like "top" monitors processes [OS X]
772
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?
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.
You can use
tail
to monitor single log file.If file is deleted, then created again you may want to use
tail -F
to actively monitor file changesIf same file is being appended too use
tail -f
to actively monitor file changesAnother alternative may be doing
less the-interesting-file
and hitting Shift+F.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
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.