« HTML5TV: video archive with slide sync without plugins | Main | LDAP server application integration with virtual LDAP »

xxd: hexdump something quickly

We have all been in this situation: you have two files which are subtly different, and you need to take a quick look in them. Let me point you towards xxd which is part of vim. Users of other editors can stop reading now! :-)

dpavlin@t61p:~/t61p/utf-8-accents$ xxd good
0000000: 506f 7669 6a65 736e 6f20 6172 6865 6f6c  Povijesno arheol
0000010: 6fc5 a16b 6920 766f 6469 c48d 2070 6f20  o..ki vodi.. po 
0000020: 4f73 6f72 750a                           Osoru.
dpavlin@t61p:~/t61p/utf-8-accents$ xxd bad
0000000: 506f 7669 6a65 736e 6f20 6172 6865 6f6c  Povijesno arheol
0000010: 6f73 cc8c 6b69 2076 6f64 6963 cc8c 2070  os..ki vodic.. p
0000020: 6f20 4f73 6f72 750a                      o Osoru.

Now, if I could only find peace of perl code which puts accents back to characters...

TrackBack

TrackBack URL for this entry:
http://blog.rot13.org/mt/mt-tb.cgi/669

Comments (1)

Zombie Author Profile Page:

The really great thing about xxd is that it can turn a hexdump back into a binary file. I haven't come across anything that can do that since I wrote my own utility for the Sinclair QL in 1986...

I used it just last week to turn a captured serial port U-boot session of a hexdump of a flash region back into a binary file I could flash on another board:


flinfo
md.b 0xbf000000 0x200000

clean up the captured output, write to boot.txt

sed 's/.*: \([0-9a-f ]*\).*/\1/' < boot.txt > boot.txt2
xxd -r -p boot.txt2 boot.img

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on December 9, 2009 7:33 PM.

The previous post in this blog was HTML5TV: video archive with slide sync without plugins.

The next post in this blog is LDAP server application integration with virtual LDAP.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.