Frequently Asked Question
When should I use curl vs wget?
Both fetch URLs from the command line, but they were built for different jobs.
curl (1996, Daniel Stenberg) is a general-purpose URL tool: it speaks
dozens of protocols (HTTP, HTTPS, FTP, SFTP, SCP, IMAP, SMTP), reads and writes
arbitrary HTTP methods (-X POST, -X PUT), handles authentication, cookies,
and headers in fine detail, and is the workhorse behind almost every shell
script that talks to a web API. It writes to stdout by default, curl https://example.com -O saves to a file named after the URL.
wget (1996, GNU) is a downloader specifically for files: it writes to a
file by default, retries automatically on failure, and can mirror entire
websites recursively with -r -np -l 5. For scripted single-file downloads
either tool works. For API calls reach for curl; for mirroring a documentation
tree reach for wget. Both ship on essentially every Linux distribution, and
both are also bundled inside billions of devices and applications via libcurl.