LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 11-04-2002, 02:18 PM   #1
Luc
Member
 
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
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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...

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

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

Rep: Reputation: 50
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
Luc
Member
 
Registered: Oct 2002
Distribution: RedHat Linux 8.0
Posts: 37

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:08 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
Open Source Consulting | Domain Registration