Friday, December 22, 2006

Copy File Trees With Tar Pipes

Copy files on a local filesystem:
(cd /foo; tar -cf - . ) | (cd /bar; tar -xpf - )

Copy files on a remote filesystem:
(cd /src; tar -cvf - foo) | (ssh other.machine 'cd /dst; tar -xf -')


http://www.cs.hmc.edu/qref/targzip.html

No comments: