Kroko Just another WordPress weblog

February 20, 2008

Transfer directories between computers using SSH and tar

Filed under: Uncategorized — admin @ 3:41 am

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/

Simple huh? 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.

No Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

Powered by WordPress