2017-07-06 17:26:44 +01:00
|
|
|
# xxd
|
|
|
|
|
2017-09-20 16:44:36 +01:00
|
|
|
> Create a hexadecimal representation (hexdump) from a binary file, or vice-versa.
|
2017-07-06 17:26:44 +01:00
|
|
|
|
2017-09-20 16:44:36 +01:00
|
|
|
- Generate a hexdump from a binary file and display the output:
|
2017-07-06 17:26:44 +01:00
|
|
|
|
|
|
|
`xxd {{input_file}}`
|
|
|
|
|
2017-09-20 16:44:36 +01:00
|
|
|
- Generate a hexdump from a binary file and save it as a text file:
|
2017-07-06 17:26:44 +01:00
|
|
|
|
|
|
|
`xxd {{input_file}} {{output_file}}`
|
|
|
|
|
2020-11-30 12:09:35 +00:00
|
|
|
- Display a more compact output, replacing consecutive zeros (if any) with a star:
|
|
|
|
|
|
|
|
`xxd -a {{input_file}}`
|
|
|
|
|
2017-09-20 16:44:36 +01:00
|
|
|
- Display the output with 10 columns of one octet (byte) each:
|
2017-07-06 17:26:44 +01:00
|
|
|
|
2017-09-20 16:44:36 +01:00
|
|
|
`xxd -c {{10}} {{input_file}}`
|
2017-07-06 17:26:44 +01:00
|
|
|
|
2019-04-06 13:34:03 +01:00
|
|
|
- Display output only up to a length of 32 bytes:
|
2018-03-19 09:14:35 +00:00
|
|
|
|
|
|
|
`xxd -l {{32}} {{input_file}}`
|
|
|
|
|
2017-09-20 16:44:36 +01:00
|
|
|
- Display the output in plain mode, without any gaps between the columns:
|
2017-07-06 17:26:44 +01:00
|
|
|
|
|
|
|
`xxd -p {{input_file}}`
|
|
|
|
|
2017-09-20 16:44:36 +01:00
|
|
|
- Revert a plaintext hexdump back into binary, and save it as a binary file:
|
2017-07-06 17:26:44 +01:00
|
|
|
|
|
|
|
`xxd -r -p {{input_file}} {{output_file}}`
|