🖥️xxd
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the xxd command with important options and switches using examples.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗ ██╗██╗ ██╗██████╗
# ╚██╗██╔╝╚██╗██╔╝██╔══██╗
# ╚███╔╝ ╚███╔╝ ██║ ██║
# ██╔██╗ ██╔██╗ ██║ ██║
# ██╔╝ ██╗██╔╝ ██╗██████╔╝
# ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝
# Convert bin/string to hex.
# Result: 34322069732074686520736f6c7574696f6e0a
echo '42 is the solution' | xxd -p
# Convert hex to bin/string.
# Result: 42 is the solution
echo '34322069732074686520736f6c7574696f6e0a' | xxd -r -p
# Make a hexdump or do the reverse with the xxd command
xxd /path/to/binary/file
# Explanation: This shows a very nice hexdump of the specified file. You can edit the output and convert it back to binary with xxd -r. But the best part is that you can configure vim to do all the converting back and forth for you, effectively turning vim into a binary editor, by adding this to your .vimrc:
# augroup Binary
# au!
# au BufReadPre *.bin let &bin=1
# au BufReadPost *.bin if &bin | %!xxd
# au BufReadPost *.bin set ft=xxd | endif
# au BufWritePre *.bin if &bin | %!xxd -r
# au BufWritePre *.bin endif
# au BufWritePost *.bin if &bin | %!xxd
# au BufWritePost *.bin set nomod | endif
# augroup END
# This will work for editing .bin files. To use it for other file extensions too, duplicate the lines within augroup and replace *.bin with *.exe for example. This tip is from vim's :help xxd.
#==============================##==============================#
# CMD XXD #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command xxd in a clear format. This allows users to quickly access the needed information for xxd without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for xxd are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.