LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to copy complete directory in Solaris? (https://www.linuxquestions.org/questions/linux-general-1/how-to-copy-complete-directory-in-solaris-443851/)

kinetik 05-11-2006 12:51 PM

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?

perfect_circle 05-11-2006 01:17 PM

Code:

cp -R directory destination

kinetik 05-11-2006 01:20 PM

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?

perfect_circle 05-12-2006 06:47 AM

can you post the exact command you have typed?

kinetik 05-12-2006 08:51 AM

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.

perfect_circle 05-12-2006 09:22 AM

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) ?

kinetik 05-13-2006 01:12 AM

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 :eek:

Thanks for you help!

keshan 06-01-2006 02:58 PM

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


All times are GMT -5. The time now is 12:25 AM.