LinuxDevCenter.com
oreilly.comSafari Books Online.Conferences.

advertisement


Linux in a Nutshell

This directory of Linux commands is from Linux in a Nutshell, 5th Edition.

Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.

Buy it now, or read it online on Safari Bookshelf.



od

od [options] [files] od --traditional [file] [[+] offset [[+] label] ]

Dump the specified files to standard output. The default is to dump in octal format, but other formats can be specified. With multiple files, concatenate them in the specified order. If no files are specified or file is -, read from standard input. With the second form, using the --traditional option, only one file can be specified.

Options

For the following options, see the later Arguments section for an explanation of the arguments bytes, size, and type. If no options are specified, the default is -A o -t d2 -w 16.

-a

Print as named characters. Same as -ta.

-A radix, --address-radix=radix

Specify the radix (base) for the file offsets printed at the beginning of each output line. The possible values are:

d

Decimal.

n

None; do not print an offset.

o

Octal; the default.

x

Hexadecimal.

-b

Print as octal bytes. Same as -toC.

-c

Print as ASCII characters or backslash escapes. Same as -tc.

-d

Print as unsigned decimal shorts. Same as -tu2.

-f

Print as floating-point. Same as -tfF.

-h

Print as hexadecimal shorts. Same as -tx2.

--help

Display a usage message and exit.

-i

Print as decimal shorts. Same as -td2.

-j bytes, --skip-bytes=bytes

Skip the specified number of input bytes before starting.

-l

Print as decimal longs. Same as -td4.

-N bytes, --read-bytes=bytes

Format and print only the specified number of input bytes.

-o

Print as octal shorts. Same as -to2.

-s bytes, --strings[=bytes]

Output strings that are at least bytes ASCII graphic characters long (default is 3 if bytes is not specified for --strings).

-t type, --format=type

Format the output according to type, where type is a string of one or more of the characters listed in the Arguments section. If more than one type is specified, each output line is written once in each specified format. If a trailing z is appended to type, od appends any printable characters to the end of each output line.

--traditional

Accept arguments in the traditional form, which takes a single file specification with an optional offset and label, as shown in the second form of the command. offset is an octal number indicating how many input bytes to skip over. label specifies an initial pseudo-address, which is printed in parentheses after any normal address. Both the offset and the label can begin with an optional plus sign (+), and can have a trailing decimal point (.) to force the offset to be interpreted as a decimal number and/or a trailing b to multiply the number of bytes skipped by offset by 512.

-v, --output-duplicates

Print all lines, including duplicates. By default, only the first of a series of identical lines is printed, and an asterisk is printed at the beginning of the following line to indicate that there were duplicates.

--version

Display version information and exit.

-w bytes, --width[=bytes]

Dump bytes input bytes to each output line. Defaults to 16 if this option is omitted. If --width is specified but bytes is omitted, the default is 32.

-x

Print as hexadecimal shorts. Same as -tx2.

Arguments

bytes

Specify a number of bytes. Treated as hexadecimal if it begins with 0x or 0X, as octal if it begins with 0, or as decimal otherwise. Append b to multiply by 512, k to multiply by 1024, or m to multiply by 10248576.

size

Specified as part of type to indicate how many bytes to use in interpreting each number. Types a and c do not take a size. For other types, size is a number. For type f, size can also be one of the following:

D

Double.

F

Float.

L

Long double.

For the remaining types (d, o, u, x), size can be one of the following in addition to a number:

C

Character.

I

Integer.

L

Long.

S

Short.

type

Specify the format type. The possible types are:

a

Named character.

c

ASCII character or backslash escape.

dsize

Signed decimal, with size bytes per integer.

fsize

Floating point, with size bytes per integer.

o

Octal, with size bytes per integer.

u

Unsigned decimal, with size bytes per integer.

x

Hexadecimal, with size bytes per integer.


Linux Resources
  • Linux Online
  • The Linux FAQ
  • linux.java.net
  • Linux Kernel Archives
  • Kernel Traffic
  • DistroWatch.com


  • Sponsored by: