26.15.2. hexdump, hd -- ASCII, decimal, hexadecimal, octal dump
以十六進制方式顯示二進制檔案
neo@netkiller ~ % hexdump -n 256 -C ./coutput/HelloWorld.bin
00000000 36 30 36 30 36 30 34 30 35 32 33 34 31 35 36 31 |6060604052341561|
00000010 30 30 30 66 35 37 36 30 30 30 38 30 66 64 35 62 |000f57600080fd5b|
00000020 36 31 30 32 65 33 38 30 36 31 30 30 31 65 36 30 |6102e38061001e60|
00000030 30 30 33 39 36 30 30 30 66 33 30 30 36 30 36 30 |00396000f3006060|
00000040 36 30 34 30 35 32 36 30 30 34 33 36 31 30 36 31 |6040526004361061|
00000050 30 30 34 63 35 37 36 30 30 30 33 35 37 63 30 31 |004c576000357c01|
00000060 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 |0000000000000000|
*
00000090 30 30 30 30 30 30 30 30 39 30 30 34 36 33 66 66 |00000000900463ff|
000000a0 66 66 66 66 66 66 31 36 38 30 36 33 34 65 64 33 |ffffff1680634ed3|
000000b0 38 38 35 65 31 34 36 31 30 30 35 31 35 37 38 30 |885e146100515780|
000000c0 36 33 36 64 34 63 65 36 33 63 31 34 36 31 30 30 |636d4ce63c146100|
000000d0 61 65 35 37 35 62 36 30 30 30 38 30 66 64 35 62 |ae575b600080fd5b|
000000e0 33 34 31 35 36 31 30 30 35 63 35 37 36 30 30 30 |341561005c576000|
000000f0 38 30 66 64 35 62 36 31 30 30 61 63 36 30 30 34 |80fd5b6100ac6004|
00000100
26.15.3. xxd - make a hexdump or do the reverse.
neo@MacBook-Pro ~/workspace % xxd -b netkiller.dat
00000000: 00000000 00000000 00000000 11111111 00000000 00000000 ......
00000006: 00000000 00000000 11111111 11111111 11111111 11111111 ......
neo@MacBook-Pro ~ % xxd -c 2 -b netkiller.bin
00000000: 10010110 01001000 .H
跳過兩個位元組,三列顯示
neo@MacBook-Pro ~ % xxd -s 2 -c 3 -b netkiller.txt
00000002: 11101001 10011001 10001000 ...
00000005: 11100110 10011001 10101111 ...
00000008: 11100101 10110011 10110000 ...