Back to the command reference

od

FilesAdvanced In simulator In real Linux

Dump files in octal, hex and other formats

Name: od = octal dump

You can practise it right away in the simulator, and use it in real Linux mode too.

Description

od shows every byte of a file in octal (the default), hex, decimal or as characters, ideal for spotting invisible characters such as newlines, tabs or Windows \r.

Syntax

od [OPTION]... [FILE]...

Common options

-cShow characters, including \n and friends
-xHexadecimal
-t / --format TYPEThe output format, e.g. -t x1 (hexadecimal, one byte at a time)
-A xHex offsets
-N / --read-bytes BYTESRead at most BYTES bytes
-j / --skip-bytes BYTESSkip the first BYTES bytes
-v / --output-duplicatesShow repeated lines too (normally replaced by *)

Examples

  • $ echo hi | od -c

    See every byte, newline included

    Explain

Related