In this guide, you’ll explore the power of the wget command, learn its key features, understand how to install it on major Linux distributions, and see practical examples for real-world usage.
What Is Wget?
Wget is a widely used command-line utility for downloading files from the internet via protocols like HTTP, HTTPS, FTP, and FTPS.
Key points about wget:
- Non-interactive: works in scripts or background tasks
- Supports resumable downloads
- Can handle multiple files and directories recursively
- Reliable for automation and file retrieval
While
curlis great for sending requests and interacting with web services,wgetspecializes in file downloads with simplicity and reliability.
Key Features of Wget
- Download entire directories recursively
- Support for proxies
- Automatic following of redirects
- Resume interrupted downloads
- Limit download rates
- Specify output file names
- Run downloads in the background
- IPv4 and IPv6 support
- Timeout management and authentication handling
Wget works seamlessly on Linux, Windows, and macOS, making it a versatile cross-platform tool.
How to Install Wget on Linux
Wget is pre-installed on most distributions. If it’s missing, you can install it using your package manager:
# Debian/Ubuntu/Pop!_OS
sudo apt install wget -y# Red Hat/Fedora/AlmaLinux
sudo yum install wget -y# Arch/Manjaro/EndeavourOS
sudo pacman -Sy wget# OpenSUSE
sudo zypper install wget -y# Gentoo
sudo emerge -a net-misc/wget
Verify installation:
wget --version
Basic Wget Usage
The general syntax:
wget [OPTION] [URL]
1. Download a Single File
wget https://ftp.gnu.org/gnu/wget/wget2-latest.tar.gz
2. Download Multiple Files
wget https://ftp.gnu.org/gnu/wget/wget2-latest.tar.gz https://ftp.gnu.org/gnu/wget/wget2-latest.tar.lz
Or from a text file:
wget -i urls.txt
3. Download Files via HTTP and FTP
wget https://ftp.gnu.org/gnu/wget/wget2-latest.tar.gz ftp://ftp.gnu.org/gnu/wget/wget2-latest.tar.gz.sig
4. Save File with a Different Name
wget -O wget.tar.gz https://ftp.gnu.org/gnu/wget/wget2-latest.tar.gz
5. Specify Output Directory
wget -P ~/Downloads/ https://ftp.gnu.org/gnu/wget/wget2-latest.tar.gz
6. Use a Custom User Agent
wget --user-agent="Mozilla/5.0 (X11; Linux i686; rv:109.0) Gecko/20100101 Firefox/115.0" https://ftp.gnu.org/gnu/wget/wget2-latest.tar.gz
7. Resume a Large Download
wget -c https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/debian-12.0.0-amd64-DVD-1.iso
Without
-c, an interrupted download will start over with a.1extension.
8. Limit Download Rate
wget -c --limit-rate=500k https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/debian-12.0.0-amd64-DVD-1.iso
9. Download in the Background
wget -c --limit-rate=500k -b https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/debian-12.0.0-amd64-DVD-1.iso
- Check background downloads:
ps aux | grep wget
- Stop a process:
kill <PID>
10. Mirror a Website Recursively
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent https://example.com
Flags breakdown:
--mirror: enable recursive download--convert-links: adjust links for offline browsing--adjust-extension: assign proper file extensions--page-requisites: download all assets (images, CSS, JS)--no-parent: stay within the directory
⚠️ Only mirror websites with permission.
11. Download Password-Protected Files
HTTP:
wget --http-user=USER --http-password=PASSWORD https://example.com/file.zip
FTP:
wget --ftp-user=USER --ftp-password=PASSWORD ftp://example.com/file.zip
12. Use Cookies
wget --load-cookies cookies.txt https://example.com/protected-file.zip
13. Ignore SSL Certificate Check
wget --no-check-certificate https://example.com/file.zip
14. Help and Manual
wget --help
man wget
Conclusion
Wget is an essential command-line tool for downloading files, automating downloads, mirroring websites, and handling HTTP/FTP tasks efficiently. With its versatility and cross-platform support, mastering wget is invaluable for Linux users and system administrators alike.
Whether you are fetching a single file, resuming a large download, or setting up automated scripts, wget makes it simple and reliable.
And if you'd like to go a step further in supporting us, you can treat us to a virtual coffee ☕️. Thank you for your support ❤️!
We do not support or promote any form of piracy, copyright infringement, or illegal use of software, video content, or digital resources.
Any mention of third-party sites, tools, or platforms is purely for informational purposes. It is the responsibility of each reader to comply with the laws in their country, as well as the terms of use of the services mentioned.
We strongly encourage the use of legal, open-source, or official solutions in a responsible manner.


Comments