From: Robert Klemme Date: 2003-05-26T17:18:27+09:00 Subject: Re: file copy blues schrieb im Newsbeitrag news:20030524150803.22872.qmail@fran.supanetwork.co.uk... > Hi > > How do I copy an entire directory from one place to another? > > At the moment I am copying the names of all the sub directories then > creating them in the new location, then recursively going through each > of the sub directories and copying the files to the new directories > created. > > This seems like a long way around. > > Plus I also want to be able to copy the entire directory to another > machine - I was thinking of opening a socket connection to a listener on > the target machine and trying to copy the files that way. > > Any thoughts? You can do (all shell level): local: cp -a ( cd from && tar cf - . ) | ( cd && tar xf - ) remote ( cd from && tar cf - . ) | ( rsh foo@bar cd '&&' tar xf - ) with GNU tar you can do ( tar cf - -SC . ) | ( rsh foo@bar tar xf - -SC ) and for slow connections even ( tar czf - -SC . ) | ( rsh foo@bar tar xzf - -SC ) You can use ssh instead of rsh, too. Cheers robert