Wednesday, February 21, 2007

Display Non-printable Characters in Binary Files

You can use the octal dump, od, utility to display non-printable characters. Amongst other things, we have used it to detect the header bytes in a stream of binary packets.

Here's are some examples.

Displays in character format
# od -c a.out

Capture a serial stream and display in character format
# tip -9600 /dev/term/a | od -c

Capture a serial stream and display in hexadecimal format
# tip -9600 /dev/term/a | od -x

Related post

No comments: