Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Asuming I have two files, one large file and one small file, I want to write the smaller file to the large file without overwriting the remaining part of the larger file.

Both are binary files, and the large file can become very large, so I want to avoid copying the whole file, as that will take some time. Is there any standard Linux console utility to do this, or do I need to write it myself?

share|improve this question
maybe this helps you:… – user4711 Feb 24 '12 at 12:30
@Wimmel, Shouldn't this be asked on ? – Pacerier May 2 '15 at 13:15
up vote 12 down vote accepted

This will overwrite the beginning of large-file with the contents of small-file:

dd if=small-file of=large-file conv=notrunc
share|improve this answer

I don't quite understand what you mean, but you can use cat:

cat smallfile >> largefile

This will append smallfile to largefile.

share|improve this answer
smallfile needs to be at the beginning of largefile, not at the end. – Wimmel Mar 1 '11 at 10:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.