Copying with SCP

Even if you don’t already know how to use the command, scp should be a bit more familiar to you thanks to its similarity to ssh. The biggest differences come with specifying file/directory paths.

Download file/directory

scp user@ssh.example.com:/path/to/remote/source /path/to/local/destination

scp -r user@ssh.example.com:/path/to/remote/source /path/to/local/destination

Upload file/directory

scp /path/to/local/source user@ssh.example.com:/path/to/remote/destination 

scp -r /path/to/local/source user@ssh.example.com:/path/to/remote/destination 

Tar + Gzip/Gunzip

On Linux, gzip is unable to compress a folder, it used to compress a single file only. To compress a folder, you should use tar + gzip, which is tar -z.

Create archive

tar -zcvf archive.tar.gz folder1/ folder2/ folder3/ ..

Inflate archive

tar -xvf archive.tar.gz