A chronological documentation test project, nothing serious, really!

18 May 2007 Transfer directories between computers using SSH and tar

Posted by

When I need to transfer lots of files or directories between computers, I usually use tar and ssh together. Last time I used it however, I realized that perhaps not everyone knows how to do this. The procedure is very simple, and a full command could look something like this:

tar -cf - directory/ | ssh tar -xf - -C /destination/

If you want compression, just add z for gzip or j for bzip2 to both tar statements. This could be necessary if you are planning to do this over slow lines.

Tags: ,

Comments are closed.