Tuesday, April 24, 2007

Transfer directories between computers using SSH and tar at Johnny Chadda .se

Transfer directories between computers using SSH and tar at Johnny Chadda .se

Now here is a usefull tip for all us Linux ssh lovers:

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 my.other.computer 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:

Enjoy some videos after reading the blog!

Loading...