Preserving permissions when using cp
Is there a way I can preserve the permissions of a file when I use cp to copy it?
For example, say I want to copy /var to /mnt/nd/var. Files in /var are owned by many different people, but when I copy the files from /var to /mnt/nd/var as root, the files are all owned by root. :( How can I make it so that I can copy files, while not changing/perserving their ownership and permissions? Thanks! |
cp has a option for this, -P you can chhose which bits it preserves.
the reverse option is --no-preserve. On most basic commands (okay nearly all console commands) typing thecommand --help gives you all the options and for more detailed info try man thecommand |
Thanks for your help!
I was aware that I could find it by doing "cp --help" or looking at a man page, but this was a case where I didn't have access to either of those. |
All times are GMT -5. The time now is 10:05 AM. |