Viewing the hex codes of a file

Linux has a cool utility called hexdump that will output a file in hex mode. Great for looking at the raw values in a UTF-8 text file.

hexdump -C /tmp/foo.txt

Vim also ships with a xxd binary that will output a file in a hexdump style, as well as including the ASCII representation.

hexdump /tmp/foo.txt
Leave A Reply - 1 Reply
Replies
Jimmy 2009-08-02 11:34pm - No Email - Logged IP: 69.104.2.104

xxd has a generally nicer format, and will reverse a modified hexdump back into a file.

All content licensed under the Creative Commons License