LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Copy a Folder to Another Folder and Retain its Permissions (https://www.linuxquestions.org/questions/linux-newbie-8/copy-a-folder-to-another-folder-and-retain-its-permissions-4175578357/)

voshika 04-26-2016 06:53 AM

Copy a Folder to Another Folder and Retain its Permissions
 
How do I copy and paste a folder with its user permissions
(like Windows xcopy source destination /O /X /E /H /K)

Tanks
Voshika

BW-userx 04-26-2016 08:16 AM

here ya go.

Code:

sudo cp -rp /home/dirName /somewhere/else/myStuff

From cp manpage:

 -p    same as --preserve=mode,ownership,timestamps


tshikose 04-26-2016 08:24 AM

cp -a


All times are GMT -5. The time now is 04:54 AM.