4

Why does hexdump seem to miss out parts of the file, while xxd does not? The file is 32 bytes. So xxd output is correct.

$ xxd test.bin
0000000: 8888 8888 8888 8888 8888 8888 8888 8888  ................
0000010: 8888 8888 8888 8888 8888 8888 8888 8888  ................
$ hexdump -n32 -x test.bin
0000000    8888    8888    8888    8888    8888    8888    8888    8888
*
0000020
8

Because you didn't add the -v option to hexdump.

-v Cause hexdump to display all input data. Without the -v option, any number of groups of output lines, which would be identical to the immediately preceding group of output lines (except for the input offsets), are replaced with a line comprised of a single asterisk.

Therefore you need:

$ hexdump  -n32 -xv test.bin
0000000    8888    8888    8888    8888    8888    8888    8888    
0000010    8888    8888    8888    8888    8888    8888    8888    
0000020

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.