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

I want to copy the contents of an unzipped folder, wordpress/, to another existing folder.

I tried

cp -R wordpress/*.* /my/folder

but the sub-folders in wordpress/ didn't get copied over.

Why not?

share|improve this question
up vote 13 down vote accepted


cp -r wordpress/* /my/folder
share|improve this answer senstivity :) what does the -r do? – user27449 Nov 27 '10 at 3:06
This is weird. I just tested ur command line. It also works. According to the manpages, -r Copy file hierarchies and the treatment of special files is implementation-defined. While -R is more versatile. – wliao Nov 27 '10 at 3:24
MORE PERTINENTLY: There's a different ARGUMENT being provided; wordpress/*.* is NOT the same as wordpress/* - subfolders didn't get copied with . because the folder names do not include the character "." in them. – pbr Nov 27 '10 at 5:57

If you have hidden files/directories then you'll need to run the following from inside the source directory

tar pcf - .| (cd /path/to/destination; tar pxf -)

that will copy all files and folders including ones starting with a . (dot).

If you don't have hidden files/directories that need to be copied then wliao's answer will do.

(edited for clarity)

share|improve this answer

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.