|

楼主 |
发表于 2009-9-4 17:32:37
|
显示全部楼层
本帖最后由 changyongid 于 2009-9-4 17:57 编辑
我们还是先来help一下,因为看帮助文档是一个非常好的习惯。
[changyongid@localhost src]$ od --help
Usage: od [OPTION]... [FILE]...
or: od [-abcdfilosx]... [FILE] [[+]OFFSET[.]]
or: od --traditional [OPTION]... [FILE] [[+]OFFSET[.] [+][LABEL][.]]
Write an unambiguous representation, octal bytes by default,
of FILE to standard output. With more than one FILE argument,
concatenate them in the listed order to form the input.
With no FILE, or when FILE is -, read standard input.
All arguments to long options are mandatory for short options.
-A, --address-radix=RADIX decide how file offsets are printed 指定地址基数,这里的RADIX在help下面有详细的解释。
-j, --skip-bytes=BYTES skip BYTES input bytes first
-N, --read-bytes=BYTES limit dump to BYTES input bytes
-S, --strings[=BYTES] output strings of at least BYTES graphic chars
-t, --format=TYPE select output format or formats 数据显示格式 ,同样的,TYPE在help的下面也有详细的解释。
-v, --output-duplicates do not use * to mark line suppression
-w, --width[=BYTES] output BYTES bytes per output line
--traditional accept arguments in traditional form
--help 显示此帮助信息并退出
--version 输出版本信息并退出
我们比较常用的就是-A 和 -t参数了。。
RADIX的说明如下:
RADIX is d for decimal, o for octal, x for hexadecimal or n for none.
即:
d -十进制
o -八进制
x -十六进制
n -不打印偏移植
TYPE的说明如下:
TYPE is made up of one or more of these specifications:
a named character, ignoring high-order bit
c ASCII character or backslash escape ASCII字符或反斜杠序列
d[SIZE] signed decimal, SIZE bytes per integer有符号十进制数
f[SIZE] floating point, SIZE bytes per integer浮点数
o[SIZE] octal, SIZE bytes per integer八进制(系统默认值为02)
u[SIZE] unsigned decimal, SIZE bytes per integer无符号十进制数
x[SIZE] hexadecimal, SIZE bytes per integerx 十六进制数
除了选项c以外的其他选项后面都可以跟一个十进制数n,指定每个显示值所包含的字节数。
说明:od命令系统默认的显示方式是八进制,这也是该命令的名称由来(Octal Dump)。但这不是最有用的显示方式,用ASCII码和十六进制组合的方式能提供更有价值的信息输出。 |
|