1
rated 0 times
[
1]
[
0]
/ answers: 1 / hits: 418
/ 2 Years ago, tue, march 22, 2022, 4:01:56
We can truncate a big file to a size we want. For example, if I want to truncate a file to 1K byte, we can do truncate -s 1K file1
. But this changes the original file file1.
Many times I want to see a beginning part of a big binary file. To open it with vi and then converting to hex-ascii format (using !%xxd in vi) takes too long. Of course I can copy the original file into another one and truncate the new file and open it with vi. But is there any way I can just extract from the beginning of a file an amount of bytes I want into another file so that I can open the smaller file to examine the beginning data of the original file?
More From » files