tldr/pages/common/xxd.md

24 lines
602 B
Markdown
Raw Normal View History

2017-07-06 17:26:44 +01:00
# xxd
> Create a hexadecimal representation (hexdump) from a binary file, or vice-versa.
2017-07-06 17:26:44 +01:00
- Generate a hexdump from a binary file and display the output:
2017-07-06 17:26:44 +01:00
`xxd {{input_file}}`
- 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}}`
- Display the output with 10 columns of one octet (byte) each:
2017-07-06 17:26:44 +01:00
`xxd -c {{10}} {{input_file}}`
2017-07-06 17:26:44 +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}}`
- 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}}`