xxd
Create a hexadecimal representation (hexdump) from a binary file, or vice-versa. See also: `hexyl`, `od`, `hexdump`.
More info →Options (5)
-abooleanDisplay a more compact output, replacing consecutive zeros (if any) with a star
xxd {{[-a|-autoskip]}} {{input_file}}-cbooleanDisplay the output with 10 columns of one octet (byte) each
xxd {{[-c|-cols]}} {{10}} {{input_file}}-lbooleanDisplay output only up to a length of 32 bytes
xxd {{[-l|-len]}} {{32}} {{input_file}}-pbooleanDisplay the output in plain mode, without any gaps between the columns
xxd {{[-p|-postscript]}} {{input_file}}-rbooleanRevert a plaintext hexdump back into binary, and save it as a binary file
xxd {{[-r|-revert]}} {{[-p|-postscript]}} {{input_file}} {{output_file}}Examples (7)
Generate a hexdump from a binary file and display the output
xxd input_fileGenerate a hexdump from a binary file and save it as a text file
xxd input_file output_fileDisplay a more compact output, replacing consecutive zeros (if any) with a star
xxd [-a|-autoskip] input_fileDisplay the output with 10 columns of one octet (byte) each
xxd [-c|-cols] 10 input_fileDisplay output only up to a length of 32 bytes
xxd [-l|-len] 32 input_fileDisplay the output in plain mode, without any gaps between the columns
xxd [-p|-postscript] input_fileRevert a plaintext hexdump back into binary, and save it as a binary file
xxd [-r|-revert] [-p|-postscript] input_file output_file