Create a hexadecimal representation (hexdump) from a binary file, or vice-versa.

# To generate a hexdump from a binary file and display the output:
xxd <input_file>

# To generate a hexdump from a binary file and save it as a text file:
xxd <input_file> <output_file>

# To display the output with 10 columns of one octet (byte) each:
xxd -c <10> <input_file>

# To display output only upto a length of 32 bytes:
xxd -l <32> <input_file>

# To display the output in plain mode, without any gaps between the columns:
xxd -p <input_file>

# To revert a plaintext hexdump back into binary, and save it as a binary file:
xxd -r -p <input_file> <output_file>