๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

๐ŸŒ Networking September 26, 2026 9

Linux Command: wget

Download files from the web (HTTP, HTTPS, FTP)

Terminal โ€” Networking
Command
$ wget https://example.com/archive.tar.gz

wget is a non-interactive file downloader that supports HTTP, HTTPS, and FTP protocols. It is designed for reliable downloads even on unstable connections, with automatic retry and resume capabilities. wget excels at downloading files, mirroring websites, and recursive downloads. Unlike curl which outputs to stdout by default, wget saves directly to files. It handles redirects, cookies, authentication, and can download entire website structures. wget is ideal for scripting and automation, working in the background, downloading large files over unreliable connections, and creating offline mirrors of websites.

Syntax

wget [OPTION]... [URL]...

Key Options

  • -O โ€” Save to specific filename
  • -c โ€” Resume interrupted download
  • -r โ€” Recursive download
  • -q โ€” Quiet mode
  • -b โ€” Download in background
  • --mirror โ€” Mirror a website (recursive + timestamps)

Examples

Download a file

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

Resume interrupted download

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

Download with custom filename

wget -O backup.sql.gz https://db.example.com/dump/latest

Pro Tips

  • Always use wget -c for large files. If the connection drops, re-running the same command resumes from where it stopped.
  • wget is better for file downloads, recursive crawling, and background operations. curl is better for API testing, custom headers, and supporting many protocols.
  • wget -r without -l (depth limit) can download entire websites and consume massive disk space. Always set a depth limit.

Learn more: Full wget reference โ†’

Share this tip