示例一 比较各种参数的输出结果
[root@new55 ~]# echo /etc/passwd | hexdump
0000000 652f 6374 702f 7361 7773 0a64
000000c
[root@new55 ~]# echo /etc/passwd | od -x
0000000 652f 6374 702f 7361 7773 0a64
0000014
[root@new55 ~]# echo /etc/passwd | xxd
0000000: 2f65 7463 2f70 6173 7377 640a /etc/passwd.
[root@new55 ~]# echo /etc/passwd | hexdump -C <== 规范的十六进制和ASCII码显示(Canonical hex+ASCII display )
00000000 2f 65 74 63 2f 70 61 73 73 77 64 0a |/etc/passwd.|
0000000c
[root@new55 ~]# echo /etc/passwd | hexdump -b <== 单字节八进制显示(One-byte octal display)
0000000 057 145 164 143 057 160 141 163 163 167 144 012
000000c
[root@new55 ~]# echo /etc/passwd | hexdump -c <== 单字节字符显示(One-byte character display)
0000000 / e t c / p a s s w d \n
000000c
[root@new55 ~]# echo /etc/passwd | hexdump -d <== 双字节十进制显示(Two-byte decimal display)
0000000 25903 25460 28719 29537 30579 02660
000000c
[root@new55 ~]# echo /etc/passwd | hexdump -o <== 双字节八进制显示(Two-byte octal display)
0000000 062457 061564 070057 071541 073563 005144
000000c
[root@new55 ~]# echo /etc/passwd | hexdump -x <== 双字节十六进制显示(Two-byte hexadecimal display)
0000000 652f 6374 702f 7361 7773 0a64
000000c
[root@new55 ~]# echo /etc/passwd | hexdump -v
0000000 652f 6374 702f 7361 7773 0a64
000000c
比较来比较去,还是hexdump -C的显示效果更好些。