cp -a or cp -R differences
I have been reading through man cp . I was trying to sort it out.
Code:
-a, --archive Code:
-p, --preserve Code:
-R, --recursive |
No. -R is just for copying whole trees intact.
-a and -p are for something more subtle: keeping timestamps, permissions and ownership the same. This is useful for archiving but not for anything else. For regular use, I assume -R is the option you're looking for. |
does -R keep permissions the same(not ownership)?
|
Depends on who's copying it.
Remember, cp has to write a new copy. The written files will normally be owned by the person who writes them, right? That's how it'll be with -R. So if you cp -R your friend's directory of files into your own home directory (e.g. "cp -R ~myfriend/mp3s/ ~"), the copy will be owned by YOU, not your friend. I'm pretty sure you won't ever need -a or -p unless you're archiving stuff for backup purposes. Knowing cp -R is useful, however. It sounds like you're just reading through manpages in case you find something that happens to be worth knowing, am I right? |
I was following the LFS-5.0 book. so I was trying to read and understand what it was telling me to do. Just trying to make sence of it all:)
edit/added I understand ownership would change, but was not sure about permissions. |
All times are GMT -5. The time now is 09:53 AM. |