Download file with SCP linux / Terminal

August 01, 2012

Very simple really, using ssh connection and grabbing a single file to the current directory

scp user@server.com:/home/your-site/www/mysql-backup.sql.gz .

To desktop

scp user@server.com:/home/your-site/www/mysql-backup.sql.gz ~/Desktop/

Syncing a whole folder and it's permissions

-R is recursive
-p is keeping intact the permissions, structures, creation times etc.

scp -pR user@server.com:/home/your-site/www/mysql-backup.sql.gz ~/Desktop/

About me

Hello! I'm David Heward, how are you going? I'm a Senior Devops/Build Engineer, specialising in AWS & Cloud Automation. Based in London. Strong 10+ year background in Software development. Have a read of my blog. Have a look at some of my working projects. Contact me at @davehewy or on Linkedin.