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)
How to hexdump large files
I doubt what you really need is an ASCII hex dump of the file - the end result is going to be over 3x the original size. What you need is to find is a decent hex editor that allows you to view/search/manipulate the file & gives you a hex dump display. If you back your question out a step and ask about what you want to accomplish by hex-dumping an 8GB file, you might get more helpful answers & solutions that don't result in being stuck going through some 30GB of hard-to-search text. –
Sadie
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
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
© 2022 - 2024 — McMap. All rights reserved.