Need to copy one file into another file

Say I have one file (foo) containing "aaaaaaaaaaaaaaaaaaaa"
and another file (bar) containing "bbbbb"
I want to be able to copy the contents of bar into the first 5 bytes of foo.
My first attempt was
dd if=bar, of=foo, ds=1, count =5

After runnint that, bar still contained "aaaaaaaaaaaaaaaaaaaa"

I would use the actual files, but one is 256Mib, and the other is 1.6 TiB

echo -n "12345678" > foo

echo -n "bbb" > bar

dd conv=notrunc if=bar of=foo

cat foo
bbb45678

cat bar
bbb
2 Likes

That's got it! Thanks a bunch!