|
42樓

樓主 |
發(fā)表于 2009-9-4 17:32:37
|
只看該作者
本帖最后由 changyongid 于 2009-9-4 17:57 編輯
我們還是先來(lái)help一下,因為看幫助文檔是一個(gè)非常好的習慣。
[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的說(shuō)明如下:
RADIX is d for decimal, o for octal, x for hexadecimal or n for none.
即:
d -十進(jìn)制
o -八進(jìn)制
x -十六進(jìn)制
n -不打印偏移植
TYPE的說(shuō)明如下:
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有符號十進(jìn)制數
f[SIZE] floating point, SIZE bytes per integer浮點(diǎn)數
o[SIZE] octal, SIZE bytes per integer八進(jìn)制(系統默認值為02)
u[SIZE] unsigned decimal, SIZE bytes per integer無(wú)符號十進(jìn)制數
x[SIZE] hexadecimal, SIZE bytes per integerx 十六進(jìn)制數
除了選項c以外的其他選項后面都可以跟一個(gè)十進(jìn)制數n,指定每個(gè)顯示值所包含的字節數。
說(shuō)明:od命令系統默認的顯示方式是八進(jìn)制,這也是該命令的名稱(chēng)由來(lái)(Octal Dump)。但這不是最有用的顯示方式,用ASCII碼和十六進(jìn)制組合的方式能提供更有價(jià)值的信息輸出。 |
|