tldr/pages/common/od.md

26 lines
981 B
Markdown
Raw Normal View History

# od
2016-11-27 11:44:16 +00:00
> Display file contents in hexadecimal, octal, or printable character format.
2016-11-27 11:12:20 +00:00
> Optionally display the byte offsets into the file.
2016-12-04 11:22:44 +00:00
- Display file in octal format 8 bytes per line with the byte offsets in octal as well replacing duplicate lines with `*`:
2016-11-27 11:44:16 +00:00
`od {{/path/to/file}}`
2016-11-27 11:12:20 +00:00
- Display file in hexadecimal format with byte offsets in hexadecimal, 4 bytes per line with each entry 1 byte long:
2016-11-27 11:44:16 +00:00
`od --address-radix=x --format=x1 --width=4 -v {{/path/to/file}}`
2016-11-27 11:12:20 +00:00
- Display only printable strings of at least 5 characters long in the file along with the byte offsets in hexadecimal:
2016-11-27 11:44:16 +00:00
`od --address-radix=x --string=5 -v {{/path/to/file}}`
2016-12-02 11:01:58 +00:00
- Read only given number of first bytes of a file and display it in the hexadecimal format:
2016-12-02 11:01:58 +00:00
`od --address-radix=x --format=x --read-bytes 100 -v {{/path/to/file}}`
- Display file in hexadecimal format along with its character representation, also do not print byte offsets:
2016-11-27 11:12:20 +00:00
`od --address-radix=n --format=xz -v {{/path/to/file}}`