I'm sorry if the answer to this question is easy. But I've been searching the web as well as experimenting it myself for a while without coming up with any solution. I have 2 directories named source and dest. How can I use the 'cp' command to copy all the files and directories inside "source" into "dest".
In "source" we have: a.jpg, b.jpg, subdir1, subdir2.
In "dest" we have: c.jpg, subdir3.
After copying, in "dest" we have: a.jpg, b.jpg, c.jpg, subdir1, subdir2 (as well as hidden files/directories too). I don't mind if it overwrites the content of "dest" (because sometimes "dest" is an empty directory").
I have tried:
cp -r source/* dest/*
cp -r source/* dest/
cp -r source/* dest
cp -r source/ dest/*
cp -r source/ dest/
cp -r source/ dest
cp -r source dest/*
cp -r source dest/
cp -r source dest
But with all the above, I've always ended up with either nothing new in "dest", or a subdirectory "source" inside "dest/".
So, is there any way to have 'cp' do the trick, or do we need another tool to do this.
The reason I'm asking is I'm building an customized live debian system, which has root as its default user at every boot time. Because /etc/skel is automatically copied to new normal users only, I have to write a script to do the job for a super user.
Thanks for all your help and suggestion