od - write files in octal or other formats
| Use Case | Command | Description |
|---|---|---|
| 🖥️ Octal dump of file | od file | Default octal dump with offsets |
| 🔢 Hexadecimal dump | od -x file | Output as hexadecimal two-byte units |
| 📝 Character representation | od -c file | Printable characters, C escapes |
| ⏭️ Skip bytes | od -j 100 file | Skip 100 bytes before formatting |
| 📏 Limit output bytes | od -N 50 file | Only output 50 bytes of input |
| 🔤 Show strings | od -S 3 file | Output strings of at least 3 printable characters |
| 🎛️ Custom format | od -t x1z file | Hex bytes with character representation |
od [OPTION]... [FILE]...
od [-abcdfilosx]... [FILE] [[+]OFFSET[.][b]]
od [OPTION]... --traditional [FILE] [[+]OFFSET[.][b] [[+]LABEL[.][b]]]
'od' writes an unambiguous representation of each FILE ('-' means standard input), or standard input if none are given.
Each line of output consists of the offset in the input, followed by groups of data from the file. By default, 'od' prints the offset in octal, and each group of file data is a C 'short int's worth of input printed as a single octal number.
If OFFSET is given, it specifies how many input bytes to skip before formatting and writing. By default, it is interpreted as an octal number, but the optional trailing decimal point causes it to be interpreted as decimal. If no decimal is specified and the offset begins with '0x' or '0X' it is interpreted as a hexadecimal number. If there is a trailing 'b', the number of bytes skipped will be OFFSET multiplied by 512.
If a command is of both the first and second forms, the second form is assumed if the last operand begins with '+' or (if there are two operands) a digit. For example, in 'od foo 10' and 'od +10' the '10' is an offset, whereas in 'od 10' the '10' is a file name.
The program accepts the following options. Also see Common options.
-A RADIX, --address-radix=RADIX
📏 Select the base in which file offsets are printed. RADIX can be one of the following:
d — decimalo — octal (default)x — hexadecimaln — none (do not print offsets)--endian=ORDER
🔄 Reorder input bytes, to handle inputs with differing byte orders, or to provide consistent output independent of the endian convention of the current system. Swapping is performed according to the specified --type size and endian ORDER, which can be little or big.
-j BYTES, --skip-bytes=BYTES
⏭️ Skip BYTES input bytes before formatting and writing. If BYTES begins with '0x' or '0X', it is interpreted in hexadecimal; otherwise, if it begins with '0', in octal; otherwise, in decimal. BYTES may be, or may be an integer optionally followed by, one of the following multiplicative suffixes:
b => 512 ("blocks")KB => 1000 (KiloBytes)K => 1024 (KibiBytes)MB => 1000*1000 (MegaBytes)M => 1024*1024 (MebiBytes)GB => 1000*1000*1000 (GigaBytes)G => 1024*1024*1024 (GibiBytes)-N BYTES, --read-bytes=BYTES
📏 Output at most BYTES bytes of the input. Prefixes and suffixes on 'bytes' are interpreted as for the -j option.
-S BYTES, --strings[=BYTES]
🔤 Instead of the normal output, output only "string constants": at least BYTES consecutive ASCII graphic characters, followed by a zero byte (ASCII NUL). Prefixes and suffixes on BYTES are interpreted as for the -j option. If BYTES is omitted with --strings, the default is 3.
-t TYPE, --format=TYPE
🎛️ Select the format in which to output the file data. TYPE is a string of one or more of the below type indicator characters. If you include more than one type indicator character in a single TYPE string, or use this option more than once, 'od' writes one copy of each output line using each of the data types that you specified, in the order that you specified. Adding a trailing "z" to any type specification appends a display of the single byte character representation of the printable characters to the output line generated by the type specification.
a — named character, ignoring high-order bitc — printable single byte character, C backslash escape or a 3 digit octal sequenced — signed decimalf — floating point (see Floating point)o — octalu — unsigned decimalx — hexadecimalC — charS — shortI — intL — longF — floatD — doubleL — long double-v, --output-duplicates
📋 Output consecutive lines that are identical. By default, when two or more consecutive output lines would be identical, 'od' outputs only the first line, and puts just an asterisk on the following line to indicate the elision.
-w[N], --width[=N]
📏 Dump N input bytes per output line. This must be a multiple of the least common multiple of the sizes associated with the specified output types. If this option is not given at all, the default is 16. If N is omitted, the default is 32.
These options are shorthands for format specifications. GNU 'od' accepts any combination of shorthands and format specification options. These options accumulate.
-a📝 Output as named characters. Equivalent to -t a.
-b🔢 Output as octal bytes. Equivalent to -t o1.
-c🔤 Output as printable single byte characters, C backslash escapes or 3 digit octal sequences. Equivalent to -t c.
-d🔢 Output as unsigned decimal two-byte units. Equivalent to -t u2.
-f🔢 Output as floats. Equivalent to -t fF.
-i🔢 Output as decimal ints. Equivalent to -t dI.
-l🔢 Output as decimal long ints. Equivalent to -t dL.
-o🔢 Output as octal two-byte units. Equivalent to -t o2.
-s🔢 Output as decimal two-byte units. Equivalent to -t d2.
-x🔢 Output as hexadecimal two-byte units. Equivalent to -t x2.
od --traditional [FILE] [[+]OFFSET[.][b] [[+]LABEL[.][b]]]
Recognize the non-option label argument that traditional 'od' accepted. The LABEL argument is interpreted just like OFFSET, but it specifies an initial pseudo-address. The pseudo-addresses are displayed in parentheses following any normal address.
An exit status of zero indicates success, and a nonzero value indicates failure.
Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-31 12:50 @216.73.217.152
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format