您的位置:首页 > 运维架构 > Linux

linux 二进制文件显示方法 --- xxd hexdump od 用法大比拼

2014-06-29 19:36 1261 查看
http://blog.csdn.net/hejinjing_tom_com/article/details/12651985

--------------------------------------------------------------------------------

linux 二进制文件显示方法 --- xxd hexdump od 用法大比拼。

最后发现: xxd -g1, hexdump -C 是最简单最清晰的用法。 显示很规范,与ultraedit 一致

其它用法仅做参考。

--------------------------------------------------------------------------------

[root@hjj ~]# echo /etc/passwd |xxd

0000000: 2f65 7463 2f70 6173 7377 640a /etc/passwd.

[root@hjj ~]# echo /etc/passwd |xxd -g1

0000000: 2f 65 74 63 2f 70 61 73 73 77 64 0a /etc/passwd.

[root@hjj ~]# echo /etc/passwd |hexdump

0000000 652f 6374 702f 7361 7773 0a64

000000c

[root@hjj ~]# echo /etc/passwd |hexdump -C

00000000 2f 65 74 63 2f 70 61 73 73 77 64 0a |/etc/passwd.|

0000000c

[root@hjj ~]# echo /etc/passwd |od

0000000 062457 061564 070057 071541 073563 005144

0000014

[root@hjj ~]# echo /etc/passwd |od -A x -x

000000 652f 6374 702f 7361 7773 0a64

00000c

[root@hjj ~]# echo /etc/passwd |od -A x -t x1

000000 2f 65 74 63 2f 70 61 73 73 77 64 0a

00000c

[root@hjj ~]# echo /etc/passwd |od -A x -t c

000000 / e t c / p a s s w d \n

00000c

[root@hjj ~]# echo /etc/passwd |od -A x -t x1 -t c

000000 2f 65 74 63 2f 70 61 73 73 77 64 0a

/ e t c / p a s s w d \n

00000c

推荐用法:

[root@hjj ~]# echo /etc/passwd |xxd -g1

[root@hjj ~]# echo /etc/passwd |hexdump -C

[root@hjj ~]# echo /etc/passwd |od -A x -t x1 -t c
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: