od is a tool used to dump files or input in different presentation formtas like octal, decimal, hexadecimal etc. od command especially useful for binary analysis also can be used to debug Linux scripts for unwanted characters.
Help
$ od --help

Syntax
od [OPTION]... [FILE]...
Display File Octal Mode
Octal mode is calculated with base 8 . We can print the file contents with -b
option.
$ od -b test

Display File ASCII Mode
As octal mode do not provide a human readable format. We humans generally uses ASCII or character mode to read. We can print all contents of the file with -c
option.
$ od -c test

Display File Decimal Mode
Decimal mode is base 10 for numeric formatting. Humans generally uses decimal mode to made math and numerical operations. We will use -i
option.
$ od -i test

Display File Hexadecimal 2 Byte Units
While displaying the printed as one byte interpretation. If the chars are Unicode and written as 2 byte displaying them 2 byte is a requirement.
$ od -x test

Display File Octal 2 Byte Units
We can also display provided file as 2 byte units in octal mode. We will use -o
option.
$ od -o test

Display Byte Offset Hexadecimal
We can display byte offsets by using -Ax
option.
$ od -Ax test

Display Byte Offset Octal
We can display byte offsets by using -Ao
option.
$ od -Ao test

Display Byte Offset Decimal
We can display byte offsets by using -Ad
option.
$ od -Ad test

Hide Byte Offset
While displaying file data we can hide offset information with -An
option
$ od -An test

Start Displaying From Specified Byte
While displaying files the files may contain a lot of data. We may looking for some specific part of the file. Here we can specify the start byte index with -j
option.
$ od -j10 -c test

End Displaying At Specified Byte
Another option to specify the part we want to display is setting the end index of the file. We will set the end index number with -N
option.
$ od -N50 -c test

Hexadecimal Specify Start and Length Of Displayed Bytes
If we merge two previous example we can specify start and length of the byte index with -j
and -N
options.
$ od -j30 -N50 -c test

Read Input From Command Line
Up to now we have provided related data from a file. ob command can also read data from standard input. We will use -
to specify reading data from standard input. In order to end the read press CTRL+d
$ od -c -

Display Hidden Characters
Some characters do not displayed by regular file commands and tools. But od command can display these hidden characters by default.
$ od -c test