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 errorsHow it works: curl versus wget
wgetis built for one thing: download a file (and it can resume and mirror a whole site).curlis 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-fsSLflags on curl are a common set for install scripts:-ffail on an HTTP error,-squiet,-Sstill show the error,-Lfollow 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.