LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-26-2016, 07:53 AM   #1
voshika
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)

Tanks
Voshika
 
Old 04-26-2016, 09:16 AM   #2
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 3,096

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
here ya go.

Code:
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
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 329

Rep: Reputation: 67
cp -a
 
  


Reply


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


All times are GMT -5. The time now is 03:38 AM.

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