Skip to content

Instantly share code, notes, and snippets.

@wteuber
Created September 18, 2014 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wteuber/286358ef1cd17f3100e5 to your computer and use it in GitHub Desktop.
Save wteuber/286358ef1cd17f3100e5 to your computer and use it in GitHub Desktop.
Hex dump/restore binary file
# cat, print file.bin's binary content
cat file.bin
# =>
# DUMP - convert binary content to hex string
xxd -p file.bin | tr -d '\n'
# => 48656c6c6f20576f726c640a
# RESTORE - convert hex string to binary content
echo 48656c6c6f20576f726c640a | xxd -r -p
# => Hello World
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment