Scroll to navigation

OD(1) General Commands Manual OD(1)

NAME

od - Dump files in octal and other formats

SYNOPSIS

od [--help] [-A|--address-radix] [-j|--skip-bytes] [-N|--read-bytes] [--endian] [-S|--strings] [-a ] [-b ] [-c ] [-d ] [-D ] [-o ] [-I ] [-L ] [-i ] [-l ] [-x ] [-h ] [-O ] [-s ] [-X ] [-H ] [-e ] [-f ] [-F ] [-t|--format] [-v|--output-duplicates] [-w|--width] [--traditional] [-V|--version] [FILENAME]

DESCRIPTION

Dump files in octal and other formats

OPTIONS

Print help information.
Select the base in which file offsets are printed.
Skip bytes input bytes before formatting and writing.
limit dump to BYTES input bytes
byte order to use for multi-byte formats

Possible values:

  • big
  • little
output strings of at least BYTES graphic chars. 3 is assumed when BYTES is not specified.
named characters, ignoring high-order bit
octal bytes
ASCII characters or backslash escapes
unsigned decimal 2-byte units
unsigned decimal 4-byte units
octal 2-byte units
decimal 8-byte units
decimal 8-byte units
decimal 4-byte units
decimal 8-byte units
hexadecimal 2-byte units
hexadecimal 2-byte units
octal 4-byte units
decimal 2-byte units
hexadecimal 4-byte units
hexadecimal 4-byte units
floating point double precision (64-bit) units
floating point single precision (32-bit) units
floating point double precision (64-bit) units
select output format or formats
do not use * to mark line suppression
output BYTES bytes per output line. 32 is implied when BYTES is not specified.
compatibility mode with one input, offset and label.
Print version

EXTRA

Displays data in various human-readable formats. If multiple formats are specified, the output will contain all formats in the order they appear on the command line. Each format will be printed on a new line. Only the line containing the first format will be prefixed with the offset.

If no filename is specified, or it is "-", stdin will be used. After a "--", no more options will be recognized. This allows for filenames starting with a "-".

If a filename is a valid number which can be used as an offset in the second form, you can force it to be recognized as a filename if you include an option like "-j0", which is only valid in the first form.

RADIX is one of o,d,x,n for octal, decimal, hexadecimal or none.

BYTES is decimal by default, octal if prefixed with a "0", or hexadecimal if prefixed with "0x". The suffixes b, KB, K, MB, M, GB, G, will multiply the number with 512, 1000, 1024, 1000^2, 1024^2, 1000^3, 1024^3, 1000^2, 1024^2.

OFFSET and LABEL are octal by default, hexadecimal if prefixed with "0x" or decimal if a "." suffix is added. The "b" suffix will multiply with 512.

TYPE contains one or more format specifications consisting of:
a for printable 7-bits ASCII
c for utf-8 characters or octal for undefined characters
d[SIZE] for signed decimal
f[SIZE] for floating point
o[SIZE] for octal
u[SIZE] for unsigned decimal
x[SIZE] for hexadecimal SIZE is the number of bytes which can be the number 1, 2, 4, 8 or 16,
or C, S, I, L for 1, 2, 4, 8 bytes for integer types,
or F, D, L for 4, 8, 16 bytes for floating point. Any type specification can have a "z" suffix, which will add a ASCII dump at
the end of the line.

If an error occurred, a diagnostic message will be printed to stderr, and the exit code will be non-zero.

VERSION

v(uutils coreutils) 0.8.0

EXAMPLES

Display file using default settings: octal format, 8 bytes per line, byte offsets in octal, and duplicate lines replaced with `*`:

od path/to/file

Display file in verbose mode, i.e. without replacing duplicate lines with `*`:

od [-v|--output-duplicates] path/to/file

Display file in hexadecimal format (2-byte units), with byte offsets in decimal format:

od [-t|--format] x [-A|--address-radix] d [-v|--output-duplicates] path/to/file

Display file in hexadecimal format (1-byte units), and 4 bytes per line:

od [-t|--format] x1 [-w|--width=]4 [-v|--output-duplicates] path/to/file

Display file in hexadecimal format along with its character representation, and do not print byte offsets:

od [-t|--format] xz [-A|--address-radix] n [-v|--output-duplicates] path/to/file

Read only 100 bytes of a file starting from the 500th byte:

od [-N|--read-bytes] 100 [-j|--skip-bytes] 500 [-v|--output-duplicates] path/to/file

The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail.

2026-05-17