查看linux od 命令源代码,linux od命令输出文件内容

od(octal dump)输出文件内容

语 法:od [-abcdfhilovx][-A ][-j ][-N ][-s ][-t ][-w ][--help][--version][文件...]

补充说明:od 指令会读取所给予的文件的内容,并将其内容以八进制字码呈现出来。

参 数:

-a 此参数的效果和同时指定"-ta"参数相同。

-A 选择要以何种基数计算字码。

-b 此参数的效果和同时指定"-toC"参数相同。

-c 此参数的效果和同时指定"-tC"参数相同。

-d 此参数的效果和同时指定"-tu2"参数相同。

-f 此参数的效果和同时指定"-tfF"参数相同。

-h 此参数的效果和同时指定"-tx2"参数相同。

-i 此参数的效果和同时指定"-td2"参数相同。

-j或--skip-bytes= 略过设置的字符数目。

-l 此参数的效果和同时指定"-td4"参数相同。

-N或--read-bytes= 到设置的字符数目为止。

-o 此参数的效果和同时指定"-to2"参数相同。

-s或--strings= 只显示符合指定的字符数目的字符串。

-t或--format= 设置输出格式。

-v 或--output-duplicates 输出时不省略重复的数据。

-w或--width= 设置每列的最大字符数。

-x 此参数的效果和同时指定"-h"参数相同。

--help 在线帮助。

--version 显示版本信息。

例如:以双字节单位十六进制数的对照输出格式,使用命令的字符,忽略高阶的方式查看/root/mbr文件内容。

[root@localhost ~]# dd if=/dev/sda of=/root/mbr bs=512 count=1

记录了1+0 的读入

记录了1+0 的写出

512字节(512 B)已复制,0.000297123 秒,1.7 MB/秒

//备份MBR(主引导扇区)信息到/root/mbr文件

[root@localhost ~]# od -xa /root/mbr

0000000    48eb    1090    d08e    00bc    b8b0    0000    d88e    c08e

k   H dle dle  so   P   < nul   0   8 nul nul  so   X  so   @

0000020    befb    7c00    00bf    b906    0200    a4f3    21ea    0006

{   > nul   |   ? nul ack   9 nul stx   s   $   j   ! ack nul

0000040    be00    07be    0438    0b75    c683    8110    fefe    7507

nul   >   > bel   8 eot   u  vt etx   F dle soh   ~   ~ bel   u

0000060    ebf3    b416    b002    bb01    7c00    80b2    748a    0203

s   k syn   4 stx   0 soh   ; nul   |   2 nul  nl   t etx stx

0000100    0080    8000    49fc    0008    0800    90fa    f690    80c2

nul nul nul nul   |   I  bs nul nul  bs   z dle dle   v   B nul

0000120    0275    80b2    59ea    007c    3100    8ec0    8ed8    bcd0

u stx   2 nul   j   Y   | nul nul   1   @  so   X  so   P   <

0000140    2000    a0fb    7c40    ff3c    0274    c288    f652    80c2

nul  sp   {  sp   @   |   < del   t stx  bs   B   R   v   B nul

0000160    5474    41b4    aabb    cd55    5a13    7252    8149    55fb

t   T   4   A   ;   *   U   M dc3   Z   R   r   I soh   {   U

0000200    75aa    a043    7c41    c084    0575    e183    7401    6637

*   u   C  sp   A   | eot   @   u enq etx   a soh   t   7   f

0000220    4c8b    be10    7c05    44c6    01ff    8b66    441e    c77c

vt   L dle   > enq   |   F   D del soh   f  vt  rs   D   |   G

0000240    1004    c700    0244    0001    8966    085c    44c7    0006

eot dle nul   G   D stx soh nul   f  ht     bs   G   D ack nul

0000260    6670    c031    4489    6604    4489    b40c    cd42    7213

p   f   1   @  ht   D eot   f  ht   D  ff   4   B   M dc3   r

0000300    bb05    7000    7deb    08b4    13cd    0a73    c2f6    0f80

enq   ; nul   p   k   }   4  bs   M dc3   s  nl   v   B nul  si

0000320    f084    e900    008d    05be    c67c    ff44    6600    c031

eot   p nul   i  cr nul   > enq   |   F   D del nul   f   1   @

0000340    f088    6640    4489    3104    88d2    c1ca    02e2    e888

bs   p   @   f  ht   D eot   1   R  bs   J   A   b stx  bs   h

0000360    f488    8940    0844    c031    d088    e8c0    6602    0489

bs   t   @  ht   D  bs   1   @  bs   P   @   h stx   f  ht eot

0000400    a166    7c44    3166    66d2    34f7    5488    660a    d231

f   !   D   |   f   1   R   f   w   4  bs   T  nl   f   1   R

0000420    f766    0474    5488    890b    0c44    443b    7d08    8a3c

f   w   t eot  bs   T  vt  ht   D  ff   ;   D  bs   }  

0000440    0d54    e2c0    8a06    0a4c    c1fe    d108    6c8a    5a0c

T  cr   @   b ack  nl   L  nl   ~   A  bs   Q  nl   l  ff   Z

0000460    748a    bb0b    7000    c38e    db31    01b8    cd02    7213

nl   t  vt   ; nul   p  so   C   1   [   8 soh stx   M dc3   r

0000500    8c2a    8ec3    4806    607c    b91e    0100    db8e    f631

*  ff   C  so ack   H   |   `  rs   9 nul soh  so   [   1   v

0000520    ff31    f3fc    1fa5    ff61    4226    be7c    7d7f    40e8

1 del   |   s   %  us   a del   &   B   |   > del   }   h   @

0000540    eb00    be0e    7d84    38e8    eb00    be06    7d8e    30e8

nul   k  so   > eot   }   h   8 nul   k ack   >  so   }   h   0

0000560    be00    7d93    2ae8    eb00    47fe    5552    2042    4700

nul   > dc3   }   h   * nul   k   ~   G   R   U   B  sp nul   G

0000600    6f65    006d    6148    6472    4420    7369    006b    6552

e   o   m nul   H   a   r   d  sp   D   i   s   k nul   R   e

0000620    6461    2000    7245    6f72    0072    01bb    b400    cd0e

a   d nul  sp   E   r   r   o   r nul   ; soh nul   4  so   M

0000640    ac10    003c    f475    00c3    0000    0000    0000    0000

dle   ,   < nul   u   t   C nul nul nul nul nul nul nul nul nul

0000660    0000    0000    0000    0000    4b69    000e    0000    2080

nul nul nul nul nul nul nul nul   i   K  so nul nul nul nul  sp

0000700    0021    dd83    3f1e    0800    0000    a000    000f    dd00

! nul etx   ]  rs   ? nul  bs nul nul nul  sp  si nul nul   ]

0000720    3f1f    fe8e    ffff    a800    000f    5800    0270    0000

us   ?  so   ~ del del nul   (  si nul nul   X   p stx nul nul

0000740    0000    0000    0000    0000    0000    0000    0000    0000

nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul

0000760    0000    0000    0000    0000    0000    0000    0000    aa55

nul nul nul nul nul nul nul nul nul nul nul nul nul nul   U   *

0001000

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值