Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was recently looking into using tail -f to monitor some text files like so: tail -f /var/sometext However, when I did some testing, it doesn't seem to work. What I did was I created a new file and ran: tail -f /home/name/text Then, I opened the log in vim and did some editing, saved it, and it seems that tail is not "seeing" the change.

The weird thing is, running echo "hello" >> /home/name/text seems to work fine (tail sees the change). I read somewhere this has something to do with file descriptors and new inodes being created when saving a file. Can someone explain this for me? I didn't quite get how this actually works but I have an idea what file descriptors are though. Thanks!

share|improve this question

migrated from Jun 22 '10 at 1:46

This question came from our site for professional and enthusiast programmers.

-f follows by inode. If you want to follow by name, such as when a program completely recreates the file, then use -F instead.

share|improve this answer

tail -f watches the end of file, and when the end of file moves, it prints the new content and waits for the end of file to move again. In other words, changes in the middle of the document won't be found by tail -f, only appending.

share|improve this answer

Actually, the true story is:

tail -f monitors memory, not disk. But it can't access protected memory, such as edits to a file opened a text editor.

share|improve this answer

You must log in to answer this question.