1

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?

0

1 Answer 1

4

From the man page of cp:

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

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

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

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .