Easy Tutorial
❮ Linux Remote Login Linux Comm Ispell ❯

Linux od Command

Linux Command Manual

The Linux od command is used to output file contents.

The od command reads the contents of the given file and displays them in octal code.

Syntax

od [-abcdfhilovx][-A <code base>][-j <byte count>][-N <byte count>][-s <string char count>][-t <output format>][-w <char count per line>][--help][--version][files...]

Parameters:

Example

Create a tmp file:

$ echo abcdef g > tmp
$ cat tmp
abcdef g

Use the od command:

$ od -b tmp
0000000 141 142 143 144 145 146 040 147 012
0000011

Output using single-byte octal interpretation, note the default address format on the left is eight bytes:

$ od -c tmp
0000000   a   b   c   d   e   f       g  \n
0000011

Output using ASCII code, note including escape characters:

$ od -t d1 tmp
0000000   97   98   99  100  101  102   32  103   10
0000011

Interpret using single-byte decimal:

$ od -A d -c tmp
0000000   a   b   c   d   e   f       g  \n
0000009

Linux Command Manual

❮ Linux Remote Login Linux Comm Ispell ❯