The Linux wget Command: File Download

The Linux wget Command: File Download

wget downloads files from the web. Non-interactive - works well in scripts and Cron jobs.


Basic Usage

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

Download file.

Output name

wget -O output.tar.gz https://example.com/file.tar.gz

Custom output filename.


Options

  • -O — Output document
  • -c — Continue partial downloads
  • -q — Quiet mode
  • -v — Verbose
  • -r — Recursive
  • -np — No parent (don't ascend)
  • -l depth — Recursion depth
  • --no-check-certificate — Skip SSL验证

Examples

Continue download

wget -c large-file.tar.gz

Resume partial download.

Mirror site

wget -m -k -np https://example.com/site/

Mirror website for offline viewing.

Quiet with log

wget -q -a download.log https://example.com/file

Silent with log file.


Further Reading