Examples of the curl command

 
curl 'https://www.example.com/test.html' > test.html

curl 'https://www.example.com/test.html' \
  -H 'pragma: no-cache' \
  -H 'cache-control: no-cache' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36' \
  -H 'accept: */*' \
  -H 'sec-fetch-site: cross-site' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-dest: empty' \
  -H 'accept-language: en-US,en;q=0.9' \
  --compressed \
  > test.html

# Save downloaded file with name from the url
curl -O http://www.example.com/test.html

# Save specifying a file name
curl -o test.txt http://www.example.com/test.html

# Resume downloading
curl -C - -O http://www.example.com/test.html

curl -C - -o test.txt http://www.example.com/test.html

 

Related Snippets

•  Examples of the zip command
•  Examples of touch command
•  Examples of the wget command
•  Rename a batch of files
•  Delete a batch of files using a regular expression with the find command