Wget Command is a simple but powerful command-line tool for downloading files from the Internet. You can use it to download a single file, save an entire website, continue an interrupted download, run downloads in the background, and much more.
Wget is especially useful on Linux systems and remote servers where you may not have a graphical web browser. Once you learn its basic syntax, it can save you a surprising amount of time.
In this guide, we will explain how the Wget command works and show practical examples that beginners can start using right away.
What Is the Wget Command?
Wget, short for Web Get, is a command-line utility that retrieves files over network protocols such as HTTP, HTTPS, and FTP.
Instead of opening a browser, finding a download button, and saving a file manually, you can give Wget a URL:
wget https://example.com/file.zip
Wget connects to the remote server, requests the file, and saves it in your current directory.
This makes it useful for:
- Downloading files from remote servers
- Automating downloads with scripts
- Downloading files on servers without a desktop interface
- Continuing interrupted downloads
- Downloading multiple files
- Saving web pages for offline use
If you regularly work with Linux servers, websites, or networks, Wget is a useful command to know.
How to Check If Wget Is Installed
Before using the Wget command, check whether it is available on your system:
wget –version
If Wget is installed, you will see information about the installed version.
If the terminal reports that the command cannot be found, you may need to install it.
On Ubuntu and Debian-based Linux distributions, you can usually use:
sudo apt install wget
On Fedora-based systems:
sudo dnf install wget
Package names and installation methods can vary between operating systems and distributions.
Basic Wget Command Syntax
The basic syntax is simple:
wget [options] URL
For example:
wget https://example.com/file.zip
Here:
- wget starts the program.
- URL tells Wget what resource to request.
- [options] lets you change how the download works.
You do not need to use an option for a basic download.
How to Download a File With Wget
The most common use of Wget is downloading a single file.
Run:
wget https://example.com/document.pdf
Wget connects to the server and saves document.pdf in your current working directory.
During the download, Wget can display information such as download progress, file size, transfer speed, and estimated completion time.
Save a File With a Different Name
Sometimes you may want to choose your own filename.
Use the -O option:
wget -O guide.pdf https://example.com/document.pdf
The downloaded file will now be saved as:
guide.pdf
Be careful with uppercase and lowercase options. In command-line tools, -O and -o can have different meanings.
Download a File to a Specific Directory
Use -P when you want to place a downloaded file in a particular directory:
wget -P /home/user/downloads https://example.com/file.zip
This is helpful when you are downloading files automatically and want to keep them organized.
Continue an Interrupted Download
Large downloads sometimes stop because of a lost connection, server issue, or closed terminal.
Instead of starting again from zero, try:
wget -c https://example.com/large-file.zip
The -c option tells Wget to continue a partially downloaded file when the remote server supports resuming downloads.
This can save both time and bandwidth when working with large files.
Download Multiple Files
Wget can read URLs from a text file.
Create a file named downloads.txt containing one URL per line:
https://example.com/file1.zip
https://example.com/file2.zip
https://example.com/file3.zip
Then run:
wget -i downloads.txt
The -i option tells Wget to read the download locations from the specified file.
This is much easier than running a separate command for every URL.
Run Wget in the Background
You can also start a download and let Wget continue working in the background:
wget -b https://example.com/large-file.zip
The -b option enables background mode.
This can be particularly useful when working on remote Linux servers.
Limit the Download Speed
A large download can consume a significant amount of available bandwidth.
You can limit Wget’s transfer rate with:
wget –limit-rate=500k https://example.com/file.zip
In this example, Wget limits the download speed to approximately 500 KB per second.
This is useful when you want to download something without allowing the transfer to dominate the connection.
Download a Web Page
Wget can also save a web page:
wget https://example.com/
This downloads the HTML document returned by the server.
Wget also offers recursive options for retrieving linked content, but use them carefully. Recursive downloads can generate many requests and download much more data than expected.
Always make sure you have permission to retrieve content automatically and respect the website’s rules and server resources.
Use Wget Without Certificate Validation
You may encounter HTTPS connections where certificate verification fails.
Wget provides:
wget –no-check-certificate https://example.com/file.zip
However, you should not use this option as a normal fix.
Certificate validation helps confirm that your HTTPS connection reaches the expected server securely. Disabling that verification can expose you to security risks.
A better approach is to investigate why certificate validation failed.
Why Can Wget Fail?
A Wget download can fail for many reasons.
For example, you may see an error because:
- The URL is incorrect
- The file no longer exists
- The server rejects the request
- Your Internet connection is unavailable
- DNS cannot resolve the hostname
- HTTPS certificate validation fails
- A firewall or proxy blocks the connection
- The server requires authentication
If Wget cannot resolve a hostname, check whether DNS works correctly.
For example, you can inspect a domain with the Dig command or NSlookup command.
For a more complete process, see our DNS troubleshooting guide.
You can also check the DNS records for a domain to verify that the hostname points to the expected destination.
Useful Wget Commands at a Glance
Here are some of the most useful examples:
wget URL
Download a file.
wget -O filename URL
Save the download under a different name.
wget -P /directory URL
Save the file to a specific directory.
wget -c URL
Continue an interrupted download.
wget -i files.txt
Download URLs listed in a text file.
wget -b URL
Run the download in the background.
wget –limit-rate=500k URL
Limit download speed.
wget –version
Check the installed Wget version.
Wget vs Browser Downloads
For one ordinary file, using your browser is usually easier.
The Wget command becomes more useful when you need automation, work from a terminal, manage a remote server, resume downloads, or process a list of URLs.
It also works well in shell scripts, where a browser would be impractical.
That is why system administrators, developers, and other technical users often keep Wget in their command-line toolbox.
Conclusion
The Wget Command provides a fast and flexible way to download files directly from the command line.
Beginners can start with a simple wget URL and gradually learn options for renaming files, choosing download directories, resuming interrupted transfers, limiting bandwidth, and downloading multiple files.
You do not need to memorize every option. Learn the commands you use most often and check Wget’s built-in help when you need something more advanced:
wget –help
Once you become comfortable with Wget, it can make file downloads and repetitive server tasks much quicker, especially when working in Linux or from a remote terminal.

Hi, I’m Bella, a technology enthusiast who enjoys making complex tech topics clear, practical, and easy to understand. Outside of writing, I love trail running, biking, traveling, and photography.