The od (stands for octal dump) command displays a file in octal (base 8) format by default. It is often used for visualizing data that isn’t in a human-readable format, like the executable code of a program.
For example, consider the following text file:
We can display this file in octal format by using the od command without any options:
The first number on each line is an index into the file in octal. The remaining numbers represent the bytes in the file.
To display the file in hexadecimal format, use the -x option:
To display the file in decimal format, use the -i option:
To display the file in character format, use the -c option: