I would like a tail -f
type of behavior that reads the entire file and then continues to follow it as it's written to.
SOLUTION
Based on the answer I accepted, this works: tail -f -n +1 {filename}
Why it works: The -f
option continues to "follow" the file and output new lines as they are written to the file. The -n +1
instructs tail
to start reading the file from the first line. Using -n -10
would start with the last ten lines of the file.
Use
Using
man tail
will give you more details, the relevant excerpt follows.Try this:
where
{filename}
is the file that you want to keep an eye on. This will continuously monitor the command for changes and output the changes to stdout. It's pretty handy.