Skip to content

Latest commit

 

History

History
67 lines (42 loc) · 1.52 KB

curl.md

File metadata and controls

67 lines (42 loc) · 1.52 KB

curl

Options

  • -o : Name the output file
  • -O : Download and name it according to its remote name

Auth

  • -u [:]
  • --key : Use private (PEM) key in SSL/SSH request
  • --key-type <(DER|PEM|ENG)>: Specify key format

Net

  • -x :: Add a proxy
  • --limit-rate B: Limit download rate to bytes/sec

HTTP

  • -H : Add header to request, e.g. curl -H "Foo: bar"
  • -L: Follow 3xx (relocate) responses
  • -I: Only fetch headers

Security

  • --cacert : Specify CA-certificate (PEM) file
  • --cert-type <(DER|PEM|ENG)>: Specify cacert format
  • -k: Insecure SSL connection (ignore certificate validation failure)

Proxy

Use a proxy for a given domain -- e.g. to force traffic through ssltap, but let curl set SNI and Host-header.

ssltap -s -p 8443 example.org:443
curl https://example.org/ --connect-to example.org:443:localhost:8443

Verbosity

  • -i, --include: Include headers in output
  • --trace-ascii /dev/stderr: show full request and response
  • --no-progress-meter - disables progress meter
  • -#, --progress-bar - replaces meter with a simple progress bar
  • -s, --silent - disables progress meter and other non-response output
  • -v, --verbose - disables progress meter

Examples

# Fetch urls listed in file
xargs -n 1 curl -O < list.txt

# download sequentially numbered files
curl http://example.org/file[1-24].txt

# resume a failed download
curl -C - -o partial_file.zip http://example.com/file.zip