Streaming folders from a server over SSH using tar and gzip

This is how you can stream a folder or multiple folders from a server over SSH protocol.

To stream folders in uncompressed, raw format, run:

Since the tar file is being streamed raw, this could potentially take longer as more data is being passed between server and client. In my test for 700 megabytes of data, this command took 1:56 seconds.

There’s another method. This streams the tar file, pipes it into gzip on the remote server which comes out as compressed gzipped stream down to the client. The client then passes this compressed stream into gunzip which decompresses the stream and finally then pipes it into tar to extract it into its original folders.

With the same data as above, this method took smaller amount of time, 1:13 seconds to be exact.

Manthan Dave
I like awesome things. Currently transforming the world bit by bit. I'm a Software Engineer. (All views my own)

Leave a Comment

Your email address will not be published. Required fields are marked *

%d bloggers like this: