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'm trying to copy files from one place to another, I am using this:

cp -R /from/ /to/

However, whilst this is keeping the standard permissions, it is setting the group permissions to 0 0 (Owner/Group).

How can I copy the files over whilst keeping the correct permissions?

share|improve this question
up vote 2 down vote accepted

From the man page of cp:

   -p     same as --preserve=mode,ownership,timestamps

          preserve the specified attributes (default: mode,owner‐
          ship,timestamps),  if  possible  additional attributes:
          context, links, xattr, all

So, cp -Rp /from/ to/ should work.

share|improve this answer
Thanks very much! – Brett Apr 17 '13 at 18:02

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.