Download a file / folder using mac terminal and curl

June 15, 2009

Simply use the following command:

curl -O http://www.yoursite.com/backup/mybackup.tar.gz

Will simply download the file to your local machine and your current location.

To change the current location on your local machine firstly you can find out where you are by hittng 'ls' which will list all possible directories and files. Then you can cd into whichever the directory is that you want to end up in.

For example 'cd Desktop/Backups/'

Then when you run the command it will end up in your current location. If you mess up or want to move that file at a later date you can use the following command:

'mv  myfile.tar.gz   newlocation'

Hopefully this helps someone.


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.