LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

od

Dump files in octal and other formats

TLDR

Dump file in octal (default)
$ od [file]
copy
Dump in hexadecimal (two-byte units)
$ od -x [file]
copy
Dump as ASCII characters and backslash escapes
$ od -c [file]
copy
Dump with hex addresses and single-byte hex output
$ od -A x -t x1 [file]
copy
Skip bytes from start
$ od -j [bytes] [file]
copy
Limit output to a specific number of bytes
$ od -N [bytes] [file]
copy
Show all data without duplicate suppression
$ od -v [file]
copy
Dump as named characters (ignoring high-order bit)
$ od -a [file]
copy

SYNOPSIS

od [options] [file...]

DESCRIPTION

od (octal dump) writes an unambiguous representation of its input to standard output. By default it displays data in octal, with each line showing an offset and the data values. The tool is useful for inspecting binary files, examining non-printable characters, and debugging data formats.Duplicate lines in the output are replaced by a single \* character unless -v is used.

PARAMETERS

FILE

File(s) to dump. With no FILE, or when FILE is -, read standard input.
-A RADIX, --address-radix=RADIX
Address radix: d (decimal), o (octal), x (hex), n (none)
-t TYPE, --format=TYPE
Output type (a, c, d, f, o, u, x with optional size suffix)
-a
Named characters, same as -t a
-b
Octal bytes, same as -t o1
-c
ASCII characters or backslash escapes, same as -t c
-x
Two-byte hexadecimal, same as -t x2
-j BYTES, --skip-bytes=BYTES
Skip BYTES input bytes first
-N BYTES, --read-bytes=BYTES
Limit dump to BYTES input bytes
-v, --output-duplicates
Do not use * to mark line suppression
-w[BYTES], --width[=BYTES]
Output BYTES bytes per output line (default 32)
-S BYTES, --strings[=BYTES]
Show only NUL-terminated strings of at least BYTES printable characters
--endian={big|little}
Swap input bytes according to the specified byte order

CAVEATS

Default output is octal, which is less intuitive than hex for most modern use cases. BYTES arguments may be followed by size suffixes: b (512), KB (1000), K (1024), MB, M, etc. Part of GNU coreutils.

HISTORY

od (octal dump) originated in early Unix (Version 1, 1971) for viewing file contents in octal representation.

SEE ALSO

hexdump(1), xxd(1), hd(1)

Copied to clipboard
Kai