Different dump output styles
Binary digit dump (-b)
Instead of generating a hexadecimal dump, the use of the “-b” option allows us to create a dump that represents the binary digits of the data.
xxd -b [file path]
The above binary dump, generated using the -b option, shows that the character ‘H’ is converted to the binary sequence ‘01001000’, the character ‘e’ is converted to the binary sequence ‘01100101’, and so on.
Plain hexadecimal dump (-ps)
The “xxd -ps” option is used to generate a hexadecimal postscript-style dump, also known as plain hexdump style. It provides a specific output format where the bytes are displayed continuously without line breaks, suitable for certain applications or requirements.
xxd -ps [file path]
Uppercase hexadecimal dump (-u)
The “xxd -u” option in the xxd command is used to specify that the hexadecimal output should use uppercase characters instead of the default lowercase characters.
xxd Command in Linux
xxd is a command-line tool that is primarily used for creating and analyzing hexadecimal dumps from files. It can also be used to reverse the process and convert a hexadecimal dump back into binary form. In this article, let’s uncover the practical applications of the “xxd” command in the Linux ecosystem.
xxd Command in Linux
- What is a ‘hexadecimal dump’?
- Installing xxd on Linux
- Using xxd command:
- Generating hexadecimal dumps
- Converting hexadecimal dump to the original file
- Formatting output of xxd
- Different dump output styles
- Embedding Binary Data in C/C++ Code (xxd -i)
Contact Us