cp -r
is meant to copy files recursively, and cp -R
for copying directories recursively. But I've checked, and both appear to copy both files and directories, the same thing. So, what's the difference actually?
Linux – Difference between cp -r and cp -R (copy command)
cplinux
Best Answer
While
-R
is posix well-defined,-r
is not portable!On Linux, in the GNU and BusyBox implementations of
cp
,-r
and-R
are equivalent.On the other side, as you can read in the POSIX manual page of
cp
,-r
behavior is implementation-defined.