Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-26-2016, 07:53 AM   #1
LQ Newbie
Registered: Apr 2016
Posts: 1

Rep: Reputation: Disabled
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)

Old 04-26-2016, 09:16 AM   #2
Senior Member
Registered: Sep 2013
Distribution: Void Linux / Slackware 14.2
Posts: 4,742

Rep: Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877
here ya go.

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

From cp manpage:

 -p     same as --preserve=mode,ownership,timestamps
Old 04-26-2016, 09:24 AM   #3
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 404

Rep: Reputation: 73
cp -a


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Using terminal command -Find files in a folder and copy them to a different folder j-jock Linux - General 4 11-28-2011 03:20 AM
Scripts to list folder contents and copy images from folder and subfolders brunces Linux - Newbie 6 11-03-2011 02:23 PM
i need to copy files from one folder to another folder using shell anurupr Linux - Newbie 17 03-04-2010 10:07 AM
want to copy an inode folder from acdrom to a home directory (folder). nhbob Linux - Newbie 8 12-20-2009 12:12 PM
permissions difference between /home/..../folder and /root/folder darkleaf Linux - General 3 07-21-2005 06:23 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:23 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration