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.

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

1 Answer 1

up vote 3 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

 
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.