Pregunta

I would like to output a hexdump result of a 8go file. Is it possible to do it piece by piece ? How to specify a limited numbers of lines (I have read the man page and it seems to correpond to -n length, but it didn't work)

¿Fue útil?

Solución

Something like this? Dump i.e. byte 3600 to 3700:

$ hexdump -n 100 -s 3600 -v -e '32/1 "%02x" "\n"' some_file

-s 3600 ; search to offset 3600 before starting dump.
-n 100 ; dump 100 bytes.
-e '32/1 "%02x" "\n"' ; dump 32 bytes pr. line and print by 1 as zero padded hex.

If you need line offset instead of byte you might have to resort to e.g. sed:

$ sed -n '3701q;3600,3700p' some_file | hexdump -ve '32/1 "%02x" "\n"'

Depending all on what you are going to use the data for it is also a good candidate for a short C program ;P

Otros consejos

If you want a hexdump of a file just like you get in debug.com then you can do the following:

Debug does not allow you to open a file more than 64 K in size but there are some software which you can use on your mobile in Android. One such software available in Google Play Store is "Hex Editor". I could open a 46 MB file also in that "Hex Editor". I could see the Hex dump just like I could see a file in the debug.com

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top