od
is a command that dumps binary files to eight digits.
od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type]
[[+]offset[.][Bb]] [file ...]
File test
's content is:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
od -t x1 test
-> Express the test file by 1 byte in hexadecimal.
$ od -t x1 test
0000000 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70
0000020 71 72 73 74 75 76 77 78 79 7a 41 42 43 44 45 46
0000040 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56
0000060 57 58 59 5a 31 32 33 34 35 36 37 38 39 30 0a
0000077
od -t x1z test
-> Express 1 byte by hexadecimal and display ASCII characters on the below.
$ od -t x1c test
0000000 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70
a b c d e f g h i j k l m n o p
0000020 71 72 73 74 75 76 77 78 79 7a 41 42 43 44 45 46
q r s t u v w x y z A B C D E F
0000040 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56
G H I J K L M N O P Q R S T U V
0000060 57 58 59 5a 31 32 33 34 35 36 37 38 39 30 0a
W X Y Z 1 2 3 4 5 6 7 8 9 0 \n
0000077
od -Ad test
-> Print as demical.
$ od -Ad test
0000000 061141 062143 063145 064147 065151 066153 067155 070157
0000016 071161 072163 073165 074167 075171 041101 042103 043105
0000032 044107 045111 046113 047115 050117 051121 052123 053125
0000048 054127 055131 031061 032063 033065 034067 030071 000012
0000063
reference