Latest web development tutorials

Linux od command

Linux command Daquan Linux command Daquan

Linux od command is used to output the file contents.

Od command reads the contents of a given file and the contents of octal word presented.

grammar

od [-abcdfhilovx][-A <字码基数>][-j <字符数目>][-N <字符数目>][-s <字符串字符数>][-t <输出格式>][-w <每列字符数>][--help][--version][文件...]

Parameters:

  • -a effect of this parameter and specify "-ta" parameters the same.
  • -A <Word radix> Choose how you want to calculate the base word.
  • -b effect of this parameter and specify "-toC" the same parameters.
  • -c effect of this parameter and specify "-tC" the same parameters.
  • -d effect of this parameter and specify "-tu2" the same parameters.
  • -f effect of this parameter and specify "-tfF" the same parameters.
  • -h effect of this parameter and specify "-tx2" the same parameters.
  • -i Effect of this parameter and specify "-td2" the same parameters.
  • -j <number of characters> or --skip-bytes = <number of characters> skip number of characters set.
  • -l effect of this parameter and specify "-td4" the same parameters.
  • -N <Number of characters> or --read-bytes = <number of characters> until the number of characters set.
  • -o effect of this parameter and specify "-to2" the same parameters.
  • Comply with the specified number of characters in the string -s <string of characters> or --strings = <string of characters> Show only.
  • -t <output format> or --format = <output format> Set output format.
  • Output does not omit or duplicate -v --output-duplicates data.
  • -w <number of characters per row> or --width = <number of characters per row> Sets the maximum number of characters per column.
  • -x effect of this parameter and specify "-h" the same parameters.
  • --help online help.
  • --version display version information.

Examples

Creating tmp file:

$ echo abcdef g > tmp
$ cat tmp
abcdef g

Use the od command:

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

Single-byte octal interpretation of output, pay attention to the left side of the default address format is eight bytes:

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

Use ASCII code output, note including the escape character

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

Single-byte decimal explain

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

Linux command Daquan Linux command Daquan