I have a directory ~/dir
that contains a bunch of random folders like: ~/dir/av 801
and ~/dir/lm 320
. I want to copy the contents of every inner folder (ie: av 801) into a different directory. The contents of that folder can consist of folders or files.
This is what I guessed the bash command would be:
cp ~/dir/*/* ~/target/
But it gives this error:
cp: when copying multiple files, last argument must be a directory
Is there a bash command that can do such a thing?
-r
is not portable while-R
is.. I have modified my answer to reflect that. – Jul 01 '13 at 21:58