I have an img file which I had cloned from a disk of my RISC PC using dd:dd if=/dev/hdb of=RISCPC.IMGThe size around 2GB. I want to add 512 null bytes to the start and end of the file. What's the best way to do this using dd?
Adding null bytes to a file using dd
dd;cloning
dd if=/dev/zero of=RISCPC.IMG.new bs=1 count=512dd if=RISCPC.IMG of=RISCPC.IMG.new bs=512 seek=1dd if=/dev/zero bs=1 count=512 >> RISCPC.IMG.newmv RISCPC.IMG{.new,}If you can use cat, you might consider this:cat > RISCPC.IMG.new \    <(dd if=/dev/zero bs=512 count=1) \    RISCPC.IMG \    <(dd if=/dev/zero bs=512 count=1)mv RISCPC.IMG{.new,}