How to Download Files Using HTTPS with Wget on Ubuntu
This article provides a concise guide on downloading files securely via HTTPS using the wget utility on Ubuntu Linux. It covers the basic command syntax, specifying output directories, and troubleshooting common SSL certificate errors directly from the terminal.
Install Wget
Wget is typically pre-installed on Ubuntu. If it is missing, open the terminal and run the following command to install it:
sudo apt update
sudo apt install wgetBasic Download Command
To download a file from an HTTPS URL, type wget followed
by the link. The tool automatically negotiates the secure
connection.
wget https://example.com/file.zipSpecify Output Directory
You can save the downloaded file to a specific folder using the
-P option followed by the path.
wget -P /home/user/Documents https://example.com/file.zipRename the File
To save the file with a different name than the original, use the
-O flag followed by the desired filename.
wget -O newname.zip https://example.com/file.zipHandle Certificate Errors
If the server has an invalid SSL certificate, wget will refuse the
connection. To bypass this check, use the
--no-check-certificate flag.
wget --no-check-certificate https://example.com/file.zipVerify the Download
After the process completes, list the files in your directory to confirm the download was successful.
ls -l