1

When I use -p to preserve the file permissions of a file being copied, does it apply to the source or the destination file (if it already exists)?

Thanks

Tom
  • 731
  • 3
  • 11
  • 24

1 Answers1

4

It's preserves the source file's attributes (mode, ownership, and timestamps) in the destination. (Provided the destination file system supports it.)

If a file already exists it will be overwritten with the source and it's attributes, unless you've combined the -i flag.

Aaron Copley
  • 12,525
  • 5
  • 47
  • 68