Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

wget downloads files and web resources from the command line. Its simplest use is wget URL; options let you choose where files go, resume interrupted transfers, process URL lists, and retrieve web pages for offline use. It is particularly useful in scripts and on remote systems, but it is not a browser and cannot reliably handle sites that depend on interactive login or JavaScript.

What wget does

GNU Wget is a non-interactive downloader for HTTP, HTTPS, and FTP, with support for HTTP proxies. Because it works from a terminal, it is useful for repeatable downloads in scripts, scheduled jobs, servers, and SSH sessions. The GNU Wget overview describes its protocols and non-interactive use; the GNU Wget manual available for this article documents version 1.25.0. The version installed on your system may differ, and other implementations may not support every option shown here.

Wget can follow links for recursive retrieval, but it does not render pages like a browser or run their JavaScript. It is therefore not a dependable solution for CAPTCHA challenges, multifactor prompts, client-side login flows, or web applications that fetch content dynamically.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check whether wget is installed

Run either command in a terminal:

wget --version
command -v wget

The first prints version and build information; the second prints the executable path if it is available. If the shell reports that the command was not found, install Wget using the package manager or installation method for your operating system, then check again. Availability and package names vary across Linux distributions, macOS, Windows, and minimal container images.

#1 Best Overall
Lexar D40E 128GB Dual USB 3.2 Gen 1 Type-C Jump Drive, Champagne Silver
  • USB-C 2-in-1 storage OTG: The Lexar JumpDrive Dual Drive D40E features USB Type-A and Type-C connectors in a slim, portable form factor for easy device compatibility
  • Transfer speeds up to 100MB/s: Based on internal testing, performance may vary depending upon the host device, interface, and usage conditions. 1MB=1,000,000 bytes
  • Plug and Play: Widely compatible with USB Type-C smartphones, tablets, laptops, Macs, and traditional Type-A devices, no software installation required. The 360° swivel design allows for easy switching between connectors without the hassle of losing a cap
  • Durable & Compact: The Lexar D40E USB memory stick features a metal enclosure, withstands temperatures from 0° to 50° C (32°F to 122°F), and is lightweight at 26g with dimensions of 70.4 x 16.9 x 11.7mm
  • Security & Warranty: Securely protects files using an advanced security software solution with 256-bit AES encryption. Backed by a Lexar 3-year limited warranty

Download a file and choose where it goes

To download a direct file URL, run:

wget https://example.com/archive.tar.gz

Wget saves the response in the current directory, normally using a filename derived from the URL. Redirects and server-provided headers can affect the resulting name, so specify a destination when the exact path matters:

# Write the response to this exact file
wget -O archive.tar.gz https://example.com/download?id=123

# Put the download in this directory
wget -P ~/Downloads https://example.com/archive.tar.gz

-O writes the response to the specified file; it is not a directory option and can overwrite an existing file. Use it deliberately, especially when the URL might return an error page or unexpected content. -P selects a directory while leaving Wget to derive a filename. See the GNU Wget invocation reference for command syntax.

Quote URLs containing spaces or shell-sensitive characters. In particular, an unquoted ampersand can make the shell run the rest of the command in the background:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wget 'https://example.com/download?file=report&format=pdf'

Shell quoting protects the command as it is passed to Wget; it is not the same as URL-encoding characters. Avoid putting passwords in URLs, where they may be exposed in shell history or process listings. The GNU Wget URL-format documentation describes URL syntax and authentication behavior.

Resume, skip, or update a download

These options address different situations; choosing the right one avoids unnecessary transfers and accidental reuse of the wrong file.

Option What it does Use it when
-c / --continue Attempts to continue an existing partial local file. A transfer was interrupted and the server supports resuming that resource.
-nc / --no-clobber Skips downloading when a file with the same name already exists. You do not want to overwrite an existing filename; this does not verify that file is correct.
-N / --timestamping Uses modification times to decide whether to retrieve a newer remote file. You want to update previously downloaded resources when the remote timestamp indicates a change.

For example:

wget -c https://example.com/large-file.iso
wget -nc https://example.com/file.zip
wget -N https://example.com/file.zip

Resuming depends on the server’s range-request behavior and on the partial file corresponding to the same remote resource. A redirect, changed remote file, or mismatched local file can make continuation unsuitable. If the publisher provides a checksum, verify it after downloading rather than assuming that an existing or resumed file is complete and correct. The GNU Wget manual documents continuation and timestamping behavior.

Download a list of files

Put one URL per line in a plain text file such as urls.txt, then use -i:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
https://example.com/a.zip
https://example.com/b.zip
https://example.com/c.zip
wget -i urls.txt

You can combine a URL list with options such as continuation or no-clobber:

Rank #2
SANDISK 128GB Ultra Flair, USB-A Flash Drive, Up to 150MB/s Read Speeds
  • High-speed USB 3.0 performance of up to 150MB/s(1) [(1) Write to drive up to 15x faster than standard USB 2.0 drives (4MB/s); varies by drive capacity. Up to 150MB/s read speed. USB 3.0 port required. Based on internal testing; performance may be lower depending on host device, usage conditions, and other factors; 1MB=1,000,000 bytes]
  • Transfer a full-length movie in less than 30 seconds(2) [(2) Based on 1.2GB MPEG-4 video transfer with USB 3.0 host device. Results may vary based on host device, file attributes and other factors]
  • Transfer to drive up to 15 times faster than standard USB 2.0 drives(1)
  • Sleek, durable metal casing
  • Easy-to-use password protection for your private files(3) [(3)Password protection uses 128-bit AES encryption and is supported by Windows 7, Windows 8, Windows 10, and Mac OS X v10.9 plus; Software download required for Mac, visit the SanDisk SecureAccess support page]
wget -i urls.txt -c -nc

A batch may partly succeed, so check the terminal output or save a log when running it unattended. To save a new log, use -o; to append to an existing one, use -a:

wget -o wget.log -i urls.txt
wget -a wget.log -i urls.txt

For HTTP response details, use -S; for troubleshooting, avoid quiet mode (-q) until you no longer need diagnostics:

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

Control speed, retries, and timeouts

Bound retries and avoid overwhelming a server, especially in automated jobs. This example limits transfer rate, sets a timeout, and makes a finite number of attempts:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wget --tries=5 --timeout=30 --waitretry=5 --limit-rate=2m https://example.com/file.zip

You can also set these individually:

wget --limit-rate=500k https://example.com/file.zip
wget -t 5 https://example.com/file.zip
wget -t 0 https://example.com/file.zip
wget --timeout=30 https://example.com/file.zip

-t 0 requests unlimited retries; use it only when indefinite retries are genuinely appropriate. Retrying will not repair a permanent 404, and repeated requests can burden a server. A timeout concerns a stalled network operation, while an HTTP error is a server response. Rate limits and delays are useful when a host’s policy or your own operational needs call for them. Option details are in the GNU Wget manual.

Save a webpage and its required assets

To retrieve a page and resources Wget recognizes as necessary for displaying it, while making downloaded links more usable locally, try:

wget --page-requisites --convert-links --adjust-extension https://example.com/article/

--page-requisites retrieves referenced resources needed for the page, --convert-links rewrites downloaded links for local viewing, and --adjust-extension adds an appropriate local extension where applicable. If assets are hosted on another domain, --span-hosts may be needed, but it broadens what can be fetched.

This does not guarantee a faithful offline copy. JavaScript-injected content, API requests made after page load, authentication, expiring signed URLs, and cross-origin resources may not be captured. Wget follows supported references in HTML, XHTML, and CSS; it does not execute page scripts like a browser. See the GNU Wget recursive-download documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recursively download a site carefully

Recursive retrieval follows links, so it can fetch much more than the starting page. Begin with a constrained command and a dedicated destination directory:

Rank #3
2 Pack 64GB USB Flash Drive USB 2.0 Thumb Drives Jump Drive Fold Storage Memory Stick Swivel Design - Black
  • What You Get - 2 pack 64GB genuine USB 2.0 flash drives, 12-month warranty and lifetime friendly customer service
  • Great for All Ages and Purposes – the thumb drives are suitable for storing digital data for school, business or daily usage. Apply to data storage of music, photos, movies and other files
  • Easy to Use - Plug and play USB memory stick, no need to install any software. Support Windows 7 / 8 / 10 / Vista / XP / Unix / 2000 / ME / NT Linux and Mac OS, compatible with USB 2.0 and 1.1 ports
  • Convenient Design - 360°metal swivel cap with matt surface and ring designed zip drive can protect USB connector, avoid to leave your fingerprint and easily attach to your key chain to avoid from losing and for easy carrying
  • Brand Yourself - Brand the flash drive with your company's name and provide company's overview, policies, etc. to the newly joined employees or your customers
mkdir -p site-copy
cd site-copy
wget --recursive --level=1 --page-requisites --convert-links --no-parent --domains example.com https://example.com/docs/

Here, --recursive follows links, --level=1 limits traversal depth, --page-requisites fetches page resources, --convert-links adjusts links for local viewing, --no-parent avoids ascending above the starting path, and --domains limits permitted domains. These controls do different jobs: --no-parent does not by itself restrict domains, and domain limits do not impose a depth limit.

For example, extension filters can narrow what is retrieved:

wget -r --level=1 --no-parent --domains example.com --accept='pdf,zip' https://example.com/files/

-A and -R filter URL or filename patterns, not necessarily the resource’s actual MIME type or meaning. Query strings and server-generated filenames can make extension matching less predictable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

GNU Wget documents a default recursion depth of 5; -l 0 means unlimited recursion, not zero levels. --mirror is a mirror-oriented combination of recursive and timestamp-related behavior, not a harmless “download this page” shortcut. Links may lead to large files, calendars, feeds, generated URLs, or unrelated content. Wget’s documented default behavior respects robots.txt, but that is not a substitute for permission, copyright compliance, site terms, or server policies. Do not use recursion to bypass access controls. See the recursive-download documentation and full manual.

Use headers, authentication, cookies, and proxies

Set request headers

For a service that legitimately requires a specific header, provide it explicitly. A truthful identifier is preferable to impersonating a browser to evade restrictions.

wget --user-agent='my-downloader/1.0' https://example.com/file.zip
wget --header='Accept: application/json' https://example.com/data
wget --referer='https://example.com/' https://example.com/file.zip

Access protected downloads

For HTTP Basic authentication, Wget accepts credentials as options:

wget --user='alice' --password='REPLACE_ME' https://example.com/private/file.zip

Do not treat a literal password in a command as safe: it may be recorded in shell history or exposed through process inspection. Use a protected configuration file or an appropriate secret-handling method for your environment. HTTP authentication is also different from signing into a website through a login form. A protected web-app download may depend on session cookies, JavaScript, multifactor authentication, CAPTCHA, or a short-lived URL that Wget cannot obtain through an interactive flow.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When you already have a compatible cookie file, load it for a request or save cookies received during retrieval:

Rank #4
SIMMAX 32GB Memory Stick USB 2.0 Flash Drives Swivel Thumb Drive Pen Drive (32GB Purple)
  • GOOD VALUE PACKAGE - 1 Pack 32GB Memory Stick USB 2.0 Flash Drives with great cost performance and high quality.
  • BIG CAPACITY - The available capacity: 29.10GB-29.8GB, You can save the data of movies, music, photos, designs, programs, manuals, handouts in a high speed.Good performance in digital data storing, transferring and sharing with families, friends, workmates, clients and machines.
  • EASY TO USE & PLUG AND WORK - Support windows 7 / 8 / 10 / Vista / XP / 2000 / ME / NT Linux and Mac OS, Compatible with USB2.0 and below.
  • TWISTTURN DESIGN & EASY CARRY - The metal clip rotates 360° round the ABS plastic body which with rubber oil skin feeling finish. The capless design can avoid lossing of cap, and providing efficient protection to the USB port.
  • WARRANTY & SUPPORT - SIMMAX logo is laser printed on the USB connector surface, our products are of good quality and we promise that any problem about the product within one year since you buy.
wget --load-cookies cookies.txt https://example.com/private/file.zip
wget --save-cookies cookies.txt --keep-session-cookies https://example.com/

Use a proxy

One common shell setup is to export proxy variables before running Wget:

export http_proxy=http://proxy.example.com:8080
export https_proxy=http://proxy.example.com:8080
wget https://example.com/file.zip

To bypass proxy settings for a particular command, use:

wget --no-proxy https://example.com/file.zip

Proxy authentication, TLS interception, and environment-variable conventions can vary by operating system and network. Relevant options are documented in the GNU Wget manual.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Handle redirects and check a URL before downloading

Redirects are common for download links. To inspect server responses without retrieving the file, use --spider with --server-response:

wget --server-response --spider https://example.com/download

--spider is a useful availability check, not proof that the eventual content is correct. If a server supplies a preferred name with a Content-Disposition header, --content-disposition asks Wget to use it:

wget --content-disposition https://example.com/download

A redirect may lead to another host or a destination with different authentication requirements. In security-sensitive scripts, do not automatically trust a server-provided filename.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common wget errors

wget: command not found

The executable is either not installed or is missing from PATH. Check both before installing or adjusting your environment:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
command -v wget
echo "$PATH"
wget --version

404 Not Found

The server says there is no resource at that URL. Check spelling and capitalization, confirm the publisher’s current link, and inspect the response:

Best Value
IMEASON Swivel Design 16GB USB Flash Drive with Keychain, USB 2.0 Portable Thumb Drive Memory Stick, FAT32 Format Flashdrive for Data Storage, Photos, Music, Files (Black, 16 GB)
  • 【16GB Flash Drive】USB flash drives with 16GB capacity, meet your needs of daily use on work, school, home and travelling for photos, music, videos, files storage and transfer. IMEASON thumb drives can be used to store different files, easy to data backup.
  • 【Metal Swivel Cap Design】USB thumb drive is metal swivel cover provides extra protection for the usb thumbdrive connector, no usb drive cap to lose; keychain design makes it easier to carry without worrying lose it.
  • 【Wide Compatibility】USB drive supports Windows 7/8/10/11 / Vista / XP / Unix / 2000 / ME / NT Linux and Mac OS, also Supports USB 2.0 and 1.1 ports. USB Stick support TV, desktop, notebook computer, car, audio and other device. The USB Memory Stick is your great data storage and transfer companion with traveling and working.
  • 【Easy to use】usb memory stick is plug and play without any software installation. Just simply plug the Flashdrive into the port of your USB-compatible devices such as computer, laptop to start data storage or transmission.
  • 【What You Get】16 GB USB Flash Drive Thumb Drive, The default format of the usb storage flash drive is FAT32.
wget --server-response --spider https://example.com/file.zip

Do not add recursion as a general fix; it does not make a missing URL valid.

403 Forbidden

The request is being denied. Causes can include access restrictions, missing authentication, required cookies or headers, IP or geographic policy, anti-automation controls, or a server rejecting Wget’s default user agent. Supply legitimate authentication or documented request requirements when you have access; do not use Wget to bypass restrictions.

HTTPS certificate verification fails

Check the system clock, hostname, CA certificates, and whether a corporate proxy is intercepting HTTPS. An expired certificate, hostname mismatch, private certificate, or wrong URL can also explain the error. The option --no-check-certificate disables certificate validation; it bypasses the warning rather than repairing the cause and can permit a man-in-the-middle attacker to substitute content. Use it only for a narrowly understood, controlled case, and independently verify the file. HTTPS support itself depends on the installed build’s TLS support. See the GNU Wget manual.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A download starts over instead of resuming

Use -c for an existing partial file, then check that the local file belongs to the same resource, the server supports range requests, and a redirect or proxy is not interfering. A changed remote version or mismatched partial file is a reason to start over rather than append blindly.

Only an index page downloads, or the offline page is broken

A one-URL command fetches that resource; following links requires recursion. For a single page’s required assets, use --page-requisites --convert-links --adjust-extension rather than unlimited recursion. Missing assets, JavaScript-generated content, cross-domain dependencies, absolute URLs, authentication, and expiring URLs can still prevent a complete offline copy.

Wget downloads too much

Stop the process with Ctrl+C, isolate or remove the output directory if appropriate, and narrow the command with a depth, path, domain, or file filter. For example:

wget --recursive --level=1 --no-parent --domains example.com --accept='pdf,zip' https://example.com/files/

Review the scope before restarting; in GNU Wget, -l 0 permits unlimited recursion.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify the downloaded file

A completed transfer does not establish that a file is authentic or free of malware. If the publisher provides a SHA-256 checksum, calculate your local value and compare it with the value obtained from a trusted source:

sha256sum file.iso

On macOS, this is also commonly available:

shasum -a 256 file.iso

In Windows PowerShell:

Get-FileHash .file.iso -Algorithm SHA256

A checksum can detect corruption when the expected value is trustworthy. A digital signature can provide stronger authenticity when the signing key and verification process are trusted. HTTPS protects the connection but does not independently prove that the publisher’s original file is safe.

When to choose wget, curl, or another tool

Tool Good fit Important limitation
wget Direct downloads, resuming, URL lists, and constrained recursive retrieval or mirroring. Not a JavaScript-capable browser; recursive retrieval needs careful scope controls.
curl Constructing or inspecting HTTP requests, working with APIs, setting methods and request bodies, and piping response data. Its request-oriented workflow differs from Wget’s download-oriented defaults; neither is universally better.
aria2 Highly configurable parallel or multi-source downloads. It is a separate download manager and may not be installed by default.
Browser or browser automation Interactive login, JavaScript-heavy applications, and visual confirmation. Less suited to a simple, repeatable non-interactive shell download.
Package manager or service-specific client Installing software or accessing a service with an official supported workflow. Availability and behavior depend on the project or service.

GNU Wget2 is a separate successor project, not simply another version flag for GNU Wget 1.x. Options and behavior may differ; check the installed command’s own version and help. Its project documentation is at GNU Wget2 on GitLab.

Quick reference

Goal Command
Download one file wget URL
Choose exact output file wget -O file.ext URL
Choose destination directory wget -P directory URL
Resume partial file wget -c URL
Skip existing filename wget -nc URL
Update using timestamps wget -N URL
Download a URL list wget -i urls.txt
Show server response wget -S URL
Check availability without downloading wget --spider URL
Save or append a log wget -o wget.log URL or wget -a wget.log URL
Limit speed or retries wget --limit-rate=500k -t 5 URL
Fetch page assets wget --page-requisites --convert-links URL
Restrict recursive retrieval wget -r --level=1 --no-parent --domains example.com URL
Disable certificate checks (unsafe) wget --no-check-certificate URL

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.