I have found a reference using the following command
cp -rd * /folder_1/
and another one as
cp -dr * /folder_2/
Can you please advise what are these options "rd" or "dr"?
command linecp
I have found a reference using the following command
cp -rd * /folder_1/
and another one as
cp -dr * /folder_2/
Can you please advise what are these options "rd" or "dr"?
Best Answer
The order does not matter - you can give the options in any order
This combination will copy directories recursively (including all the contents) and copy symlinks as symlinks instead of copying the files they point to.
-d
is only needed when using-r
: it is used to override the default behaviour, which is not to follow symlinks when copying recursivelyfrom
info cp