Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In the documentation for logstash, they mention the command tail -0a

I have never heard of the -a flag and I can't find any information on google, tail --help or the man pages.

What is the difference between tail -0a foo.bar and tail foo.bar

Update

After testing this further, I wonder if it is a typo. Neither command works on my mac.

[root@interactive adaptive]# tail -0a /var/log/messages
tail: option used in invalid context -- 0


[root@interactive adaptive]# tail -a0 /var/log/messages
tail: invalid option -- 'a'
share|improve this question
    
Came here because this site mentioned "tail -0a": logstash.net/docs/1.4.2/tutorials/getting-started-with-logstash –  antak Sep 12 at 1:48

2 Answers 2

up vote 2 down vote accepted

tail -0 is a historical, deprecated way of writing tail -n 0, i.e. print the last 0 lines of the file. (So tail -0 doesn't produce any output.)

I don't know of any tail implementation that has a -a option. From context, it looks like -f was meant. tail -f makes tail keep the file open when it reaches the end, and keep watching forever in case some other program appends more data at the end of the file, and prints this appended data as it comes. So tail -0f starts at the current end of the file, and prints any data that is subsequently appended to the file.

share|improve this answer

The -0 means 0 lines, in other words, don't print any existing stuff.

None of the tail man pages mention a -a option. Perhaps they meant -f or -F, which would print any new contents written after tail started.

References:

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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