# info > od

---
type: CommandReference
command: od
mode: info
section: "3.4"
source: coreutils
---

## Quick Reference

- `od file` — dump file in octal (default)
- `od -A x file` — dump with hexadecimal addresses
- `od -t x1z file` — dump as hex bytes with ASCII characters
- `od -c file` — dump as printable characters with escapes
- `od -j 100 -N 50 file` — skip 100 bytes, output 50 bytes
- `od -S 3 file` — output only strings of 3+ printable chars
- `od -v file` — output all lines, even duplicates
- `od --endian=big -t x2 file` — interpret as big-endian 2-byte words

## Name

`od` — write files in octal or other formats

## Synopsis

shell
od [OPTION]... [FILE]...
od [-abcdfilosx]... [FILE] [[+]OFFSET[.][b]]
od [OPTION]... --traditional [FILE] [[+]OFFSET[.][b] [[+]LABEL[.][b]]]
## Options

### Address radix

- `-A RADIX, --address-radix=RADIX` — set output address base: `d` (decimal), `o` (octal), `x` (hex), `n` (none). Default: octal.

### Byte order

- `--endian=ORDER` — reorder input bytes by byte order: `little` or `big`. Swapping based on `--type` size.

### Skipping and limiting

- `-j BYTES, --skip-bytes=BYTES` — skip BYTES before output. Supports suffixes: `b` (512), `KB`, `K` (1024), `MB`, `M`, `GB`, `G`, etc.
- `-N BYTES, --read-bytes=BYTES` — output at most BYTES. Same suffix rules.

### Strings

- `-S BYTES, --strings[=BYTES]` — output only string constants of at least BYTES ASCII graphic chars followed by NUL. Default BYTES=3.

### Output format

- `-t TYPE, --format=TYPE` — specify output type(s). TYPE is string of one or more type indicators:
  - `a` — named character (ignoring high bit)
  - `c` — printable char, C backslash escape or 3-digit octal
  - `d` — signed decimal
  - `f` — floating point
  - `o` — octal
  - `u` — unsigned decimal
  - `x` — hexadecimal
  Append `z` to show printable character representation.
  For `d`, `o`, `u`, `x`: append size as decimal or size letter: `C` (char), `S` (short), `I` (int), `L` (long).
  For `f`: append `F` (float), `D` (double), `L` (long double).

### Duplicate lines

- `-v, --output-duplicates` — output consecutive identical lines (default: asterisk on second line).

### Output width

- `-w[N], --width[=N]` — output N bytes per line (must be multiple of LCM of type sizes). Default 16, omit N gives 32.

### Shorthand options (accumulate)

- `-a` — equivalent to `-t a`
- `-b` — equivalent to `-t o1`
- `-c` — equivalent to `-t c`
- `-d` — equivalent to `-t u2`
- `-f` — equivalent to `-t fF`
- `-i` — equivalent to `-t dI`
- `-l` — equivalent to `-t dL`
- `-o` — equivalent to `-t o2`
- `-s` — equivalent to `-t d2`
- `-x` — equivalent to `-t x2`

### Traditional mode

- `--traditional` — recognize traditional offset and label arguments. Syntax: `od --traditional [FILE] [[+]OFFSET[.][b] [[+]LABEL[.][b]]]`. OFFSET and LABEL interpreted as octal (decimal with `.` or hex with `0x`). Trailing `b` multiplies by 512.

## Examples

shell
# Default octal dump
od file.bin

# Hexadecimal output with ASCII representation
od -t x1z file.bin

# Skip first 512 bytes, output 1024 bytes as decimal shorts
od -j 512 -N 1024 -t d2 file.bin

# Print only strings of at least 5 printable characters
od -S 5 file.bin

# Use traditional offset syntax (skip 10 octal bytes)
od -c file +10

# Specify endianness for 2-byte unsigned integers
od --endian=big -t u2 file.bin
## See Also

- [nl invocation](coreutils.info "nl")
- [base32 invocation](coreutils.info "base32")
- [Common options](coreutils.info "Common options")

## Exit Codes

- `0` — success
- Nonzero — failure