Introduced:
The OD (octal dump) command can display files or streams in eight, decimal, hexadecimal, and ASCII codes, which are useful for accessing or visually inspecting characters in a file that cannot be displayed directly on the terminal.
Grammar:
OD [-A address in] [-t display format] File
Option Description:
-A Address binary: Displays address information in the specified input;
-T display format: Specifies the display format of the data;
-a specifies that the address is included in the system:
o Octal (System default)
D Decimal
X hex
n Do not print displacement values
-t specifies the display format of the data, the main parameters are:
C ASCII character or backslash sequence (e.g. \ n)
D Signed Decimal number
F Floating point number
o Octal (System default)
U unsigned decimal number
x hexadecimal number
Example of execution:
#od-A x-t x filename (address is 16 binary, data is 16 binary)
$ cat Text
Hello World
The OD command
$ od-a o text #地址显示为八进制, first column address
05 0000000 062550 066154 020157 067567 066162 005144 062157 061440
06 0000020 066557 060555 062156 000012
07 0000027
$ od-a D Text #地址显示为十进制
09 0000000 062550 066154 020157 067567 066162 005144 062157 061440
10 0000016 066557 060555 062156 000012
11 0000023
$ od-a x Text #地址显示为十六进制
13 000000 062550 066154 020157 067567 066162 005144 062157 061440
14 000010 066557 060555 062156 000012
15 000017
$ od-t C Text
0000000 h e l l o w o r l d \ n o d C
0000020 o m m a n d \ n
19 0000027
Linux OD command: Display files in different binary