Home » Questions » Computers [ Ask a new question ]

Overwriting the middle of a file from a block device *without* truncating file?

Overwriting the middle of a file from a block device *without* truncating file?

I have a Linux (Kubuntu) system with a large (~20Gb) file which I would like to mess with. Specifically, I want to copy the entire contents of another large file (~12Gb) to the middle of this file, and keep the bits of the file which are not overwritten.

Asked by: Guest | Views: 258
Total answers/comments: 1
Guest [Entry]

"You need to specify conv=notrunc to dd. From the manpage

Any regular output file is truncated unless the notrunc conversion value
is specified. If an initial portion of the output file is
seeked past (see the oseek operand), the output file is trun-
cated at that point."