What is Wget Command Line Tool

This article provides a comprehensive overview of Wget, a popular command-line utility used for retrieving files from the web. You will learn what Wget is, its primary features, how it operates under the hood, and practical examples of how to use it for downloading files and mirroring websites.

Understanding Wget

Wget (which stands for “World Wide Web get”) is a free, open-source command-line utility used to download files from the internet. Developed as part of the GNU Project, it supports downloading via widely used internet protocols including HTTP, HTTPS, and FTP.

Unlike web browsers, Wget is designed to be non-interactive. This means it can run in the background, allowing users to initiate a download, log off from the system, and let the process complete without any user intervention. This capability makes it an invaluable tool for system administrators, developers, and power users who need to automate data retrieval tasks.

Key Features of Wget

Common Wget Commands and Examples

To use Wget, you execute it from your terminal or command prompt followed by the URL of the file you want to download.

1. Downloading a Single File

To download a file and save it in your current directory:

wget https://example.com/file.zip

2. Saving a File with a Different Name

You can use the -O option to specify a new filename for the downloaded resource:

wget -O customized_name.zip https://example.com/file.zip

3. Resuming an Interrupted Download

If a large download gets cut off, you can resume it using the -c option:

wget -c https://example.com/largefile.iso

4. Downloading in the Background

To run a download in the background, use the -b option:

wget -b https://example.com/largefile.iso

5. Mirroring an Entire Website

To download a complete website for local offline viewing, you can use the mirror option:

wget -m https://example.com

Additional Resources

Wget offers a vast array of command-line arguments to customize your downloading experience, including rate limiting, user-agent customization, and proxy configuration. For a complete list of commands, syntax options, and advanced configurations, refer to the Wget Command line tool documentation website.