How to use wget
Download files to your instance from a server
The wget
command is used to download files from HTTP, HTTPS, or FTP servers. It is particularly useful for downloading files directly to your instance from a web server.
To upload files or directories to your instance, see our documentation on scp and rsync.
Basic syntax
Run the wget
command from an SSH session on your instance to download files:
Example
This command downloads the file located at https://www.example.com/index.html
to the current directory on your instance.
Commonly used options
Rename the downloaded file
To download the file under a different name, use the -O
option:
Example
Download index.html
from https://www.example.com/
and save it as myfile.html
:
Download to a different directory
To download a file to a directory on your instance other than the current one, specify the directory path with the -P
option:
Example
Download index.html
from https://www.example.com/
and save it to /home/ubuntu/
:
Download in background
To download a file in the background and continue running other commands, use the -b
option:
Resume a download
To resume an interrupted download, use the -c
option:
Limit download speed
To limit the download speed, use the --limit-rate
option:
Example
Additional resources
View the manual page (manpage) for wget
online. Alternatively, enter man wget
in a Linux terminal to view the manpage.