Now that the Unix pipeline makes a little sense, let’s see what we can do with the SSH protocol and pipes. Here’s a list of some really great pipes that most will find useful when combining with SSH.

1.  Compressed file transfer

Forget using scp to transfer files; you can do it with a simple SSH pipe command. No need to install anything.

tar czf - /home/localuser/filefolder 
| ssh remote-machine@ip.address.of.remote.machine 
tar -xvzf -C /home/remoteuser/

 

This uses the tar program to compress your data locally and then is piped over SSH.

From there, the remote machine receives the file and extracts it to the folder you specified.

You’ll never actually see a .tar archive, but it makes use of one.