Linux: curl (Download Web Page)

By Xah Lee. Date: .

Download One Web Page

# download a html page
curl -O http://example.org/xyz/cat.html

Download Image Sequence

# download all jpg files named cat01.jpg to cat20.jpg
curl -O http://example.org/xyz/cat[01-20].jpg
# download all jpg files named cat1.jpg to cat20.jpg
curl -O http://example.org/xyz/cat[1-20].jpg

Other Useful Options

--referer http://example.org/
Set a referer (that is, a link you came from). Some sites refuse to show content without this.
--user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0"
Set user agent. Some sites refuse to show content without this.

💡 TIP: curl cannot be used to download entire website. Use wget for that.

curl -h for help.

Linux Compress, Archive, Download