Skip to main content

Linux Octal Dump (OD) Command Examples

tip

The OD command is used to convert input into Octal format. It can be used to verify the existance of newline characters.

Example: echo is appending newline character by default.

echo 'hello' |od -c
# Output
0000000 h e l l o \n
0000006

Use -n to omit newline character.

echo -n 'hello' |od -c
# Output
0000000 h e l l o
0000005

References:

  1. Octal Dump man page
Last updated on by Yasitha Bogamuwa