Share your knowledge at the LQ Wiki.
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 11-04-2002, 02:18 PM   #1
Registered: Oct 2002
Distribution: RedHat Linux 8.0
Posts: 37

Rep: Reputation: 15
copy directorys

How to copy directorys + contents with suse linux?
Old 11-04-2002, 02:34 PM   #2
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
cp -a

So, let's say you want to copy /usr to /home/usr (which you really DON'T EVER want to do IMO)

cp -a /usr /home/usr

This should work...

Old 11-04-2002, 03:28 PM   #3
Senior Member
Registered: Jan 2002
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207

Rep: Reputation: 46
Also "man cp" is your friend!
Old 11-04-2002, 04:51 PM   #4
Senior Member
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 49
A safer way, if you want everything to be exactly the same is:

cd /path/to/source/dir
tar cf - . | (cd /path/to/destination/dir; tar xvf -)

This preserves symlinks, modification time, etc.
Old 11-05-2002, 02:12 AM   #5
Registered: Oct 2002
Distribution: RedHat Linux 8.0
Posts: 37

Original Poster
Rep: Reputation: 15
cool. thx. it worked


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
RPM Directorys scripts Linux - Software 1 01-08-2005 12:36 PM
adding directorys to apache karupt Linux - Networking 2 08-12-2004 01:49 PM
I can't make files in directorys Rangerjim Linux - Newbie 2 08-03-2004 03:28 PM
vsFTPS And virtual directorys SolidSnake Linux - Networking 10 10-12-2003 04:30 AM
Protecting directorys antken Linux - Security 3 07-30-2002 09:01 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:36 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