Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
From man cp:
-R Copy directories recursively, and do the right thing when
objects other than ordinary files or directories are encoun-
tered. (Thus, the copy of a FIFO or special file is a FIFO or
special file.)
-r Copy directories recursively, and do something unspecified with
objects other than ordinary files or directories. (Thus, it is
allowed, in fact encouraged, to have the -r option a synonym for
-R. However, silly behaviour, like that of the GNU 4.0 version
of cp is not forbidden.)
cp (coreutils) 5.2.1
Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering.
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
now, i can't reach my gentoo box but i think this man page was edited by gentoo staff. what i posted now come from my arch server. interesting thing. i always thought they - r // R - were exact the same. need to make some checks.
regards,
slackie1000
Mine definitely came from a gentoo box. Specifically, with sys-apps/coreutils-5.2.1-r6 installed. My guess is that GNU coreutils does implement -R and -r in the same manner, but the manpage describes possible other behavior for portability in scripting. I, for some reason, have always used 'cp -Rp'. Maybe I just think it looks nicer than 'cp -rp'
hi there,
indeed.
i use this setup almost only as root and 90% of cp use is for backup purpose. that's why i think is interesting to keep original attributes: ownership + time
regards,
slackie1000
Originally posted by slackie1000 hi there,
indeed.
i use this setup almost only as root and 90% of cp use is for backup purpose. that's why i think is interesting to keep original attributes: ownership + time
regards,
slackie1000
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.