bsdzone BSDZone - FreeBSD help, how-to guides, and articles.

  [ Home ]   [ Current News ]   [ Howto Archive ]   [ Books ]   [ Search ]   [ Links ]   [ Contact ]  [ About ]  


Tar Copy
General Admin - 25 Nov 04

Copy a directory with tar.

This will copy all files and symlinks.
$ ( cd /to/directory/to/copy && tar cf - . ) | (cd /copy/to/directory && tar xBf -)

This will copy to a remote machine that is enabled with ssh.
$ ( cd /to/directory/to/copy && tar cf - . ) | ssh user@remote_machine “(cd /directory/to/copy/to && tar xvpf - )”


Leave a Reply