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? |
Code:
cp -R directory destination |
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? |
can you post the exact command you have typed?
|
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. |
Quote:
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/ or is it somewhere else (/some/directory/data01) ? |
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! |
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 02:47 AM. |