od | |
Author: | AT&T Bell Laboratories |
Developer: | Various open-source and commercial developers |
Operating System: | Unix, Unix-like, IBM i |
Platform: | Cross-platform |
Genre: | Command |
License: | coreutils GPLv3+ |
od
is a command on various operating systems for displaying ("dumping") data in various human-readable output formats. The name is an acronym for "octal dump" since it defaults to printing in the octal data format.
The od
program can display output in a variety of formats, including octal, hexadecimal, decimal, and ASCII. It is useful for visualizing data that is not in a human-readable format, like the executable code of a program, or where the primary form is ambiguous (e.g. some Latin, Greek and Cyrillic characters looking similar).
od
is one of the earliest Unix programs, having appeared in version 1 AT&T Unix. It is also specified in the POSIX standards. The implementation for od
used on Linux systems is usually provided by GNU Core Utilities.
Since it predates the Bourne shell, its existence causes an inconsistency in the do
loop syntax. Other loops and logical blocks are opened by the name, and closed by the reversed name, e.g. if ... fi
and case ... esac
, but od
's existence necessitates do ... done
.
The command is available as a separate package for Microsoft Windows as part of the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities.[1] The command has also been ported to the IBM i operating system.[2]
Normally a dump of an executable file is very long. The [[head (Unix)|head]]
program prints out the first few lines of the output. Here is an example of a dump of the "Hello world" program, piped through head.
Here is an example of od
used to diagnose the output of [[echo (command)|echo]]
where the user types and after writing "Hello" to literal insert a tab and ^C
character: