od

From Initq

Jump to: navigation, search

od is an octal dumping program for Unix and Unix-like systems. It can also dump hexadecimal or decimal data.

od is one of the earliest Unix programs, having appeared in version 1 AT&T Unix. It is also specified in the POSIX standards (see external link below). The implementation for od used on Linux systems is usually provided by GNU Core Utilities.

[edit] Example session

Normally a dump of executable data is very long. The head program prints out the first few lines of the output. Here is an example of a dump of the ls program, piped through head.

 [alibaba@ohnonono junk]$ od -x /bin/ls | head -5
 0000000 457f 464c 0101 0001 0000 0000 0000 0000
 0000020 0002 0003 0001 0000 9a30 0804 0034 0000
 0000040 68a0 0001 0000 0000 0034 0020 0008 0028
 0000060 001f 001e 0006 0000 0034 0000 8034 0804
 0000100 8034 0804 0100 0000 0100 0000 0005 0000
 [alibaba@ohnonono junk]$ od -d /bin/ls | head -5
 0000000 17791 17996   257     1     0     0     0     0
 0000020     2     3     1     0 39472  2052    52     0
 0000040 26784     1     0     0    52    32     8    40
 0000060    31    30     6     0    52     0 32820  2052
 0000100 32820  2052   256     0   256     0     5     0
 [alibaba@ohnonono junk]$ od /bin/ls | head -5
 0000000 042577 043114 000401 000001 000000 000000 000000 000000
 0000020 000002 000003 000001 000000 115060 004004 000064 000000
 0000040 064240 000001 000000 000000 000064 000040 000010 000050
 0000060 000037 000036 000006 000000 000064 000000 100064 004004
 0000100 100064 004004 000400 000000 000400 000000 000005 000000
Personal tools