2016-11-26 10:01:17 +02:00
|
|
|
# od
|
|
|
|
|
2017-04-15 11:15:32 +01:00
|
|
|
> Display file contents in octal, decimal or hexadecimal format.
|
|
|
|
> Optionally display the byte offsets and/or printable representation for each line.
|
2025-01-18 18:45:33 +05:30
|
|
|
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/od-invocation.html>.
|
2016-11-26 10:01:17 +02:00
|
|
|
|
2017-04-15 11:15:32 +01:00
|
|
|
- Display file using default settings: octal format, 8 bytes per line, byte offsets in octal, and duplicate lines replaced with `*`:
|
2016-11-26 10:01:17 +02:00
|
|
|
|
2017-04-15 11:15:32 +01:00
|
|
|
`od {{path/to/file}}`
|
2016-11-26 10:01:17 +02:00
|
|
|
|
2017-04-15 11:15:32 +01:00
|
|
|
- Display file in verbose mode, i.e. without replacing duplicate lines with `*`:
|
2016-11-26 10:01:17 +02:00
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`od {{[-v|--output-duplicates]}} {{path/to/file}}`
|
2016-11-26 10:01:17 +02:00
|
|
|
|
2017-04-15 11:15:32 +01:00
|
|
|
- Display file in hexadecimal format (2-byte units), with byte offsets in decimal format:
|
2016-11-26 10:01:17 +02:00
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`od {{[-t|--format]}} {{x}} {{[-A|--address-radix]}} {{d}} {{[-v|--output-duplicates]}} {{path/to/file}}`
|
2016-11-26 10:01:17 +02:00
|
|
|
|
2017-04-15 11:15:32 +01:00
|
|
|
- Display file in hexadecimal format (1-byte units), and 4 bytes per line:
|
2016-11-26 10:01:17 +02:00
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`od {{[-t|--format]}} {{x1}} {{[-w|--width=]}}{{4}} {{[-v|--output-duplicates]}} {{path/to/file}}`
|
2016-11-26 10:01:17 +02:00
|
|
|
|
2017-04-15 11:15:32 +01:00
|
|
|
- Display file in hexadecimal format along with its character representation, and do not print byte offsets:
|
2016-11-26 10:01:17 +02:00
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`od {{[-t|--format]}} {{xz}} {{[-A|--address-radix]}} {{n}} {{[-v|--output-duplicates]}} {{path/to/file}}`
|
2016-11-26 10:01:17 +02:00
|
|
|
|
2017-04-15 11:15:32 +01:00
|
|
|
- Read only 100 bytes of a file starting from the 500th byte:
|
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`od {{[-N|--read-bytes]}} 100 {{[-j|--skip-bytes]}} 500 {{[-v|--output-duplicates]}} {{path/to/file}}`
|