Click to See Complete Forum and Search --> : copy directory


m3rlin
11-09-2001, 08:53 PM
Hi! Help i can't copy directorys :mad: ,.. well i can but with nothing in it.
For example, when i do copy <dir> to /path/..
he says omiting directory, then i go to that /path and in the directory there is nothing. How do i copy a directory and the files in it?
Thanks

chikn
11-09-2001, 09:05 PM
cp -av <directory> /your/path

Edit: I could have explained that to- The v is not -v necessary just lets me know whats happening. And the -a actually is archive I done really get the correlation but it works. Read the cp manpage
man cp

[ 09 November 2001: Message edited by: chikn ]

bdg1983
11-10-2001, 03:49 AM
The cp manpage will show you to use

cp -Rr source destination

m3rlin
11-11-2001, 06:27 AM
Thanks a lot i will try that.

m3rlin
11-11-2001, 06:31 AM
Hi!Again :)! i woud like to know what is the diference between the suse 7.2 and the suse 7.2 evoluation.
Is the evoluation like an upgrate or beta version?
Thanks

otheos
11-11-2001, 06:42 AM
And there's tar:

Say you want to copy the contents of /home/myfiles to /extra/new/myfiles

cd /extra/new
mkdir myfiles
cd myfiles
(cd /home/myfiles ; tar cf - . ) | tar xvf -

make sure all spaces are there and that you are in the target folder before you start. You can skip the v from tar xvf to make things a bit faster but you won't be seeing what is going on.

This will copy everything, keep permissions and follow softlinks etc (you can dissable this last bit if you read tar's man).