English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux od command

Linux Command大全

The Linux od command is used to output file content.

The od command reads the content of the given file and presents its content in octal character codes.

syntax

od [-abcdfhilovx][-A <base number of character codes>][-j <number of characters>][-N <number of characters>][-s <number of string characters>][-t <output format>][-w <number of characters per column>][--help][--version][file...]

parameters:

  • -a This parameter's effect is the same as specifying-ta" parameter is the same.
  • -A<base number of character codes> Choose which base to calculate character codes.
  • -b This parameter's effect is the same as specifying-toC" parameter is the same.
  • -c This parameter's effect is the same as specifying-tC" parameter is the same.
  • -d This parameter's effect is the same as specifying-tu2"The parameters are the same.
  • -f This parameter's effect is the same as specifying-tfF" parameter is the same.
  • -h This parameter's effect is the same as specifying-tx2"The parameters are the same.
  • -i This parameter's effect is the same as specifying-td2"The parameters are the same.
  • -or a number of characters--skip-bytes=<number of characters>  Skip the set number of characters.
  • -l  The effect of this parameter is the same as specifying"-td4"The parameters are the same.
  • -N<number of characters> or--read-bytes=<number of characters>  Up to the set number of characters.
  • -o  The effect of this parameter is the same as specifying"-to2"The parameters are the same.
  • -s<number of string characters> or--strings=<number of string characters>  Only display strings that match the specified number of characters.
  • -t<output format> or--format=<output format>  Set the output format.
  • -v or--output-duplicates  Do not omit duplicate data when outputting.
  • -w<number of characters per column> or--width=<number of characters per column>  Set the maximum number of characters per column.
  • -x  The effect of this parameter is the same as specifying"-h"The parameters are the same.
  • --help  Online help.
  • --version  Display version information.

Online Examples

Create tmp file:

$ echo abcdef g > tmp
$ cat tmp
abcdef g

Using the od command:

$ od -b tmp
0000000 141 142 143 144 145 146 040 147 012
0000011

Output using single-byte octal interpretation, note that the default address format on the left is eight bytes:

$ od -c tmp
0000000   a   b   c   d   e   f       g  \n
0000011

Output using ASCII code, note that it includes escape characters

$ od -t d1 tmp
0000000   97   98   99  100  101  102   32  103   10
0000011

Interpreted using single-byte decimal

$ od -A d -c tmp
0000000   a   b   c   d   e   f       g  \n
0000009

Linux Command大全