Given this file
$ cat hello.txt
hello doge world
I would like to remove a range of bytes to end up with this
$ cat hello.txt
heorld
I would like to do this with dd
if possible. The reason is because I am
already using dd
to overwrite bytes in this manner
printf '\x5E' | dd conv=notrunc of=hello.txt bs=1 seek=$((0xE))
I prefer to write back to the same file, but a different output file would be okay.
dd
? If so, you can seek the input and output with byte granularity, so a modified version of this answer followed by a call totruncate
to shorten the file ought to work. – Mark Plotnick May 11 '14 at 04:38