Hello! tail -f quick question here!

Hello,
I’m going to preface this post with the fact I’m a neophyte to linux in general and am trying to certify in the LPI-C/Linux+ standards.

I’m learning about tail -f and how it’s suppose to live update with changes to files. The text used ifup and ifdown for examples, but I was trying a random .log file that I was modding in the GUI (GNOME) and it wasn’t showing up on the terminal. I tried saving the file, and still it didn’t refresh with the changes. Does tail -f only update under certain conditions?

It is not really clear what you are doing. Instead of telling a story only, you could probably show the computer facts. (And please do so by copy/paste of the prompt, the command(s), the output and the next prompt directly from the terminal window in between CODE tags, you get the CODE tags by clicking on the # button in the tool bar of the post editor).

When you watch a file by using

tail -f  thefile

you will see any data that is added to the end of thefile.

On 2015-05-13 09:26, mrfumo wrote:
>
> Hello,
> I’m going to preface this post with the fact I’m a neophyte to linux in
> general and am trying to certify in the LPI-C/Linux+ standards.
>
> I’m learning about tail -f and how it’s suppose to live update with
> changes to files. The text used ifup and ifdown for examples, but I was
> trying a random .log file that I was modding in the GUI (GNOME) and it
> wasn’t showing up on the terminal. I tried saving the file, and still it
> didn’t refresh with the changes. Does tail -f only update under certain
> conditions?

The condition is that you grow, or append, to the file, not edit it.

Editing a file is usually done by creating a new file, copy of the
original with the modifications. The original is perhaps renamed .bak or
*~, and the new file then gets the name of the original.

tail -f (or better, tailf) can’t notice this. It still has a handle on
the original file.

Instead, do something like “echo text >> file”. Or, if it is a syslog
file, use “logger” instead to add text to it (see the man page).


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Thanks for the advice guys! makes sense that the edits weren’t showing up. Cool beans! Thanks!