Linuxlab

Downloading in Linux: curl and wget

Updated July 3, 2026

curl and wget reach the network from the terminal: they fetch files and send HTTP requests.

Common cases

curl https://example.com           # print a page to the terminal
curl -O https://site/file.tar.gz   # save to a file of the same name
curl -L -o out.html https://site   # -L follow redirects, -o name
wget https://site/file.tar.gz      # just download a file
curl -I https://site               # response headers only
curl -fsSL https://site/script.sh  # quiet, and fail on errors

How it works: curl versus wget

wget is built for one thing: download a file (and it can resume and mirror a whole site). curl is broader - a tool for any request: set the method, headers, body, and see the response. That is why curl shows up in scripts and when working with an API. The -fsSL flags on curl are a common set for install scripts: -f fail on an HTTP error, -s quiet, -S still show the error, -L follow redirects. Do not run a downloaded script blindly - read it first.

In the book

This topic is covered in full in the chapter The Linux network stack.

See also

ping and dig, ip addr and ip link, Sockets: ss.