When you manually install software, web apps, or just general files, you probably use something like FTP or SFTP to upload your files. In most instances that is sufficient, but sometimes it is quicker and easier to download the files directly from their source to your server, bypassing your local computer completely. To do this, you can use wget or curl.
To download a file from a third-party server with wget, type “wget” followed by the full URL. For example:
By default wget will download to whichever directory you are currently in, so you may want to change to a downloads directory first.
To download a file with curl, type “curl -o” followed by the URL:
curl -o http://prdownloads.sourceforge.net/webadmin/webmin-1.590.tar.gz
To give the downloaded file from wget a specific name, type it as follows:
wget -O webmin.tar.gz http://prdownloads.sourceforge.net/webadmin/webmin-1.590.tar.gz
The same setting will work for curl with the uppercase “O”.
You can download multiple files with wget simply by listing the URLs one after another with spaces. If that makes the line too long or unmanageable, you can use a file. We will explain that in part two of this tutorial.