LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-11-2006, 12:51 PM   #1
kinetik
Member
 
Registered: Dec 2005
Location: The most beautiful city in the world.
Distribution: Mostly RedHat. Also Suse, Ubuntu, PHLAK etc.
Posts: 149

Rep: Reputation: 15
How to copy complete directory in Solaris?


Hi all


How do I copy a complete directory (meaning the directory name and all its contents) to another location?
 
Old 05-11-2006, 01:17 PM   #2
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
Code:
cp -R directory destination
 
Old 05-11-2006, 01:20 PM   #3
kinetik
Member
 
Registered: Dec 2005
Location: The most beautiful city in the world.
Distribution: Mostly RedHat. Also Suse, Ubuntu, PHLAK etc.
Posts: 149

Original Poster
Rep: Reputation: 15
Thanks perfect_circle.


I tried it out, but for some reason I get a message like "/data1 could not be accessed" (which is the directory I'm trying to copy). I can cd to that directory and access the files just fine.

I'm logged in as #. Something I'm doing wrong?
 
Old 05-12-2006, 06:47 AM   #4
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
can you post the exact command you have typed?
 
Old 05-12-2006, 08:51 AM   #5
kinetik
Member
 
Registered: Dec 2005
Location: The most beautiful city in the world.
Distribution: Mostly RedHat. Also Suse, Ubuntu, PHLAK etc.
Posts: 149

Original Poster
Rep: Reputation: 15
cp -R /data01/directorytobecopied/ /home/kinetik/

Someone told me to cd into the source directory itself and do "cp -R ./ /home/kinetik". I haven't tried it yet though.
 
Old 05-12-2006, 09:22 AM   #6
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
Quote:
Originally Posted by kinetik
cp -R /data01/directorytobecopied/ /home/kinetik/

Someone told me to cd into the source directory itself and do "cp -R ./ /home/kinetik". I haven't tried it yet though.
This is really strange.

If you don't want to copy the directory itself (olny the files contained there) cd into the source directory itself and do
Code:
cp -R * /home/kinetik/
IS data01 under the root directory / ?
or is it somewhere else (/some/directory/data01) ?
 
Old 05-13-2006, 01:12 AM   #7
kinetik
Member
 
Registered: Dec 2005
Location: The most beautiful city in the world.
Distribution: Mostly RedHat. Also Suse, Ubuntu, PHLAK etc.
Posts: 149

Original Poster
Rep: Reputation: 15
Hi perfect_circle


It's sorted out now. The command I did was almost exactly as you said:

cp -R ./directorytobecopied/ /home/kinetik/

I did a cd into data01, and from there it seemed to have gone OK. data01 is in the root directory, but for some strange reason it seemed to disagree with something I did. I'm thinking if I'm going to try the exact command you gave me earlier it should work perfectly now as I think it was most probably a user-error

Thanks for you help!
 
Old 06-01-2006, 02:58 PM   #8
keshan
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
copying the entrie directory

If the command was


cp -R data01/directorytobecopied/ /home/kinetik/

instead of

cp -R /data01/directorytobecopied/ /home/kinetik/

it would be fine
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy one directory to another directory thru PHP? green_njk Programming 1 01-06-2006 06:55 AM
copy files from directory to directory without subfile ALInux Linux - General 2 06-03-2005 11:51 AM
how do i copy from a directory from one patition to another? webazoid Linux - Software 1 07-14-2004 04:47 PM
Please help, how do I copy one file to another directory lexington Linux - Newbie 4 04-04-2004 10:17 AM
SuSE 8.1 ftp complete directory tree size? cav Linux - General 2 04-01-2003 12:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:34 PM.

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