Checking Binary Files with hexdump

Sooner or later, the question about what format a data file exists in will come up. One can use the hexdump program with the “-C” option to view a binary file. For example, the following command


hexdump -C data.seg | head -n 20


produced the following listing. The 240 byte trace header is listed from byte 00000000 to byte 000000f0. The first sample is at byte 000000f0, and the 4 byte float value is F7 EC 97 40. This is a IEEE float representation of the first data sample with a value of 4.7476763725280761. The float is single precision representation.

{hexlist}
00000000  00 00 00 00 00 00 00 00  e9 03 00 00 18 00 00 00  |................|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 03 00  |................|
00000020  00 00 01 00 11 00 00 00  e4 44 01 00 d7 4b 01 00  |.........D...K..|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  00 00 00 00 9c ff 9c ff  40 42 0f 00 ef 41 0f 00  |........@B...A..|
00000050  40 42 0f 00 34 42 0f 00  00 00 00 00 00 00 00 00  |@B..4B..........|
00000060  00 00 00 00 00 00 00 00  00 00 00 00 f6 ff 00 00  |................|
00000070  00 00 a0 0f fa 00 00 00  00 00 18 00 00 00 00 00  |................|
00000080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000090  00 00 00 00 00 00 e8 03  00 00 00 00 d3 07 81 00  |................|
000000a0  0d 00 20 00 37 00 00 00  00 00 00 00 00 00 00 00  |.. .7...........|
000000b0  00 00 00 00 00 00 00 00  00 00 00 00 b4 00 00 00  |................|
000000c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000d0  00 00 00 00 00 00 00 00  00 00 00 00 30 30 30 31  |............0001|
000000e0  30 30 30 31 00 00 00 00  41 31 30 30 00 00 00 00  |0001....A100....|
000000f0  f7 ec 97 40 a7 eb b1 40  05 8d f9 3e 4e d5 a9 c0  |...@...@...>N...|
00000100  8e 09 95 c0 ca e1 13 3e  ea 7b 09 40 bc 42 0f 3f  |.......>.{.@.B.?|
00000110  91 65 01 c0 6f 9d 95 c0  31 97 a0 c0 35 f3 0c c0  |.e..o...1...5...|
00000120  ad a3 0a bf 2e 3b b4 bf  d8 80 98 bf 05 8d f9 be  |.....;..........|
00000130  91 65 01 c0 b2 2e 4a c0  1a e4 d6 bf 91 65 01 3e  |.e....J......e.>|
hexlist