Binary "tail" a file

Goyuix picture Goyuix · Oct 24, 2008 · Viewed 13.2k times · Source

I would guess most people on this site are familiar with tail, if not - it provides a "follow" mode that as text is appended to the file tail will dump those characters out to the terminal.

What I am looking for (and possibly to write myself if necessary) is a version of tail that works on binary files. Basically I have a wireless link that I would like to trickle a file across as it comes down from another network link. Looking over the tail source code it wouldn't be too hard to rewrite, but I would rather not reinvent the wheel! This wouldn't strictly be "tail" as I would like the entire file to be copied, but it would watch as new bytes were added and stream those.

Ideas?

Answer

Adam Pierce picture Adam Pierce · Oct 24, 2008

Pipe it to hexdump:

tail -f somefile | hexdump -C