od
fileLinux/Unix
The od command is one of the most frequently used commands in Linux/Unix-like operating systems. od Dump files in octal and other formats
Quick Reference
Command Name:
od
Category:
file
Platform:
Linux/Unix
Basic Usage:
od [options] [arguments]
Common Use Cases
Syntax
od [options] [file...]
Options
Option | Description |
---|---|
-A, --address-radix=RADIX |
Output format for file offsets: d (decimal), o (octal), x (hexadecimal), n (none) |
-j, --skip-bytes=BYTES |
Skip BYTES input bytes before reading |
-N, --read-bytes=BYTES |
Limit dump to BYTES input bytes |
-S, --strings[=BYTES] |
Output strings of at least BYTES graphic characters (default 3) |
-t, --format=TYPE |
Select output format (see table below) |
-v, --output-duplicates |
Do not use * to mark line suppression |
-w, --width[=BYTES] |
Output BYTES bytes per output line (default 16) |
--traditional |
Accept arguments in traditional form |
--help |
Display help information and exit |
--version |
Output version information and exit |
Format Types:
Type | Description |
---|---|
a |
Named character |
c |
ASCII character or backslash escape |
d[SIZE] |
Signed decimal, SIZE bytes per integer |
f[SIZE] |
Floating point, SIZE bytes per number |
o[SIZE] |
Octal, SIZE bytes per integer |
u[SIZE] |
Unsigned decimal, SIZE bytes per integer |
x[SIZE] |
Hexadecimal, SIZE bytes per integer |
z |
Printable characters or "." for non-printable |
SIZE Specifiers:
Specifier | Description |
---|---|
C |
sizeof(char) |
S |
sizeof(short) |
I |
sizeof(int) |
L |
sizeof(long) |
1 |
1 byte |
2 |
2 bytes |
4 |
4 bytes |
8 |
8 bytes |
Examples
How to Use These Examples
The examples below show common ways to use the od
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
od -t x1 file.bin