Forrest logo
back to the od tool

od:tldr:3f633

od: Display file in hexadecimal format (2-byte units), with byte offsets in decimal format.
$ od --format=${x} --address-radix=${d} -v ${filename}
try on your machine

This command is using the od command-line tool to display the contents of a file in different formats.

Here's the breakdown of each component in the command:

  • od: This is the command itself, which stands for "octal dump". It is a tool commonly used to display the content of binary files in various formats.

  • --format=${x}: This option specifies the format in which the file content will be displayed. ${x} is a placeholder that should be replaced with the desired format. For example, --format=o will display the content in octal format, --format=d will display it in decimal format, and so on. It depends on the implementation of od command what specific formats are supported.

  • --address-radix=${d}: This option defines the radix (numbering base) used for displaying memory addresses. ${d} is a placeholder that should be replaced with the desired radix. For example, --address-radix=o will display addresses in octal, --address-radix=d will display them in decimal, etc.

  • -v: This option stands for "verbose" and instructs od to display more detailed information about each byte being printed. It typically includes the address and content of each byte.

  • ${filename}: This is a placeholder that should be replaced with the name of the file that you want to examine using od.

To use this command, you would replace ${x}, ${d}, and ${filename} with the desired values, for example:

od --format=o --address-radix=o -v my_file.bin

This would display the content of the file my_file.bin in octal format, with addresses in octal, and with verbose output.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the od tool