Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

Is it possible to follow a binary file from the beginning, a la tail -f?

This is useful in some cases, for example if I'm scping a file to a remote server, and at the same time I want to feed it to another process (yes, I know I can use ssh+cat tricks).

As far as I read from the FM, tail is written having text files in mind.

Is there any simple way of doing such operations using standard posix tools?

share|improve this question
Where does it say that tail can only be used with text files? – rozcietrzewiacz Nov 28 '11 at 15:34
@rozcietrzewiacz On older unices, text-oriented utilities such as tail didn't always cope with binary files: they might choke on null bytes or omit stray bytes after the last newline in the input files. Modern systems do cope. – Gilles Nov 28 '11 at 17:23
up vote 8 down vote accepted

tail works with binary data just as well as with text. If you want to start at the very beginning of the file, you can use tail -c +1 -f.

share|improve this answer

Your Answer


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.