od

od

The od command will dump a file into a specific format. This command is often used to check on byte codes of binary files.

Options

The options are available by first using the -t to signify the type of output.


A named character

c ASCII character

O octal format

x hexidecimal


example:


od -t c data


0000000 a c p i \n a d d u s e r . c o n

0000020 f \n a d j t i m e \n a l i a s e

0000040 s \n a l i a s e s . d b \n a l s

0000060 a \n a l t e r n a t i v e s \n a

0000100 n a c r o n t a b \n a p m \n a p

0000120 t \n a t . d e n y \n b a s h . b

0000140 a s h r c \n b a s h _ c o m p l

0000160 e t i o n \n b a s h _ c o m p l

0000200 e t i o n . d \n b o g o f i l t

0000220 e r . c f \n b o n o b o - a c t

0000240 i v a t i o n \n c a l e n d a r


od data


0000000 061541 064560 060412 062144 071565 071145 061456 067157

0000020 005146 062141 072152 066551 005145 066141 060551 062563

0000040 005163 066141 060551 062563 027163 061144 060412 071554

0000060 005141 066141 062564 067162 072141 073151 071545 060412

0000100 060556 071143 067157 060564 005142 070141 005155 070141

0000120 005164 072141 062056 067145 005171 060542 064163 061056

0000140 071541 071150 005143 060542 064163 061537 066557 066160

0000160 072145 067551 005156 060542 064163 061537 066557 066160

0000200 072145 067551 027156 005144 067542 067547 064546 072154

---cut---



od -t x data


0000000 69706361 6464610a 72657375 6e6f632e

0000020 64610a66 6d69746a 6c610a65 65736169

0000040 6c610a73 65736169 62642e73 736c610a

0000060 6c610a61 6e726574 76697461 610a7365

0000100 7263616e 61746e6f 70610a62 70610a6d

0000120 74610a74 6e65642e 61620a79 622e6873

0000140 72687361 61620a63 635f6873 6c706d6f

0000160 6f697465 61620a6e 635f6873 6c706d6f

0000200 6f697465 0a642e6e 6f676f62 746c6966

0000220 632e7265 6f620a66 6f626f6e 7463612d

0000240 74617669 0a6e6f69 656c6163 7261646e

0000260 7264630a 726f6365 68630a64 63737461

0000300 74706972 6f630a73 6c6f736e 6f630a65

---cut---