|
od
(=octal dump).
Display contents as octal numbers. This can be useful when the output
contains non-printable characters. For example, a filename may contain
non-printable characters and be a real pain. This can also be handy to
view binary files.
Examples:
dir | od -c | more
(I would probably rather do: ls -b to see any non-printable characters
in filenames).
cat my_file | od -c |more
od my_file |more
Comparison of different outputs:
Show 16 first characters from a binary (/bin/sh) as ASCII characters or
backslash escapes (octal):
od -N 16 -c /bin/sh
output:
0000000 177 E L F 001 001 001
\0 \0 \0 \0 \0 \0 \0 \0
\0
Show the same binary as named ASCII characters:
od -N 16 -a /bin/sh
output:
0000000 del E L F soh soh soh
nul nul nul nul nul nul nul nul nul
Show the same binary as short hexcadecimals:
od -N 16 -t x1 /bin/sh
output:
0000000 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Show the same binary as octal numbers:
od -N 16 /bin/sh
output:
0000000 042577 043114 000401 000001 000000 000000 000000 000000
Next > Back
to "Learn Linux Commands"
|