Curl: Difference between revisions

Content added Content deleted
(→‎One-Liners: added data raw)
Line 68: Line 68:
curl -O https://domain.com/file.zip -O https://domain.com/file2.zip
curl -O https://domain.com/file.zip -O https://domain.com/file2.zip
Download files securely via SSH curl -u user sftp://server.domain.com/path/to/file
Download files securely via SSH curl -u user sftp://server.domain.com/path/to/file
curl -u username:password download_URL
curl -u username:password https://domain.com
Get HTTP header information curl -I http://domain.com
Get HTTP header information curl -I http://domain.com
Access an FTP server curl ftp://ftp.domain.com --user username:password
Access an FTP server curl ftp://ftp.domain.com --user username:password
Download a file via FTP curl ftp://ftp.domain.com/file.zip --user username:password
Download a file via FTP curl ftp://ftp.domain.com/file.zip --user username:password
curl -u ftpuser:password -O ftp://ftp_pub/public_html/index.html
curl -u ftpuser:password -O ftp://ftp_pub/public_html/index.html
Upload a file to the FTP server curl -T file.zip ftp://ftp.domain.com/ --user username:password
Upload a file to the FTP server curl -T file.zip ftp://ftp.domain.com/ --user username:password
curl -u ftpuser:password -T linuxtechi.txt ftp://ftp_pub/public_html/
curl -u ftpuser:password -T linuxtechi.txt ftp://ftp_pub/public_html/
To upload multiple files to FTP serve curl -u ftpuser:password -T "(linuxtechi1.txt linuxtechi2.txt)" ftp://ftp_pub/public_html/
To upload multiple files to FTP server curl -u ftpuser:password -T "(linuxtechi1.txt linuxtechi2.txt)" ftp://ftp_pub/public_html/
Deleting files from ftp server curl ftp://ftp_pub/public_html -X 'DELE linuxtechi.zip' --user ftpuser:password
Deleting files from ftp server curl ftp://ftp_pub/public_html -X 'DELE linuxtechi.zip' --user ftpuser:password
Handle URL redirects curl -L http://domain.com
Handle URL redirects curl -L http://domain.com
Debug level details curl -v http://domain.com
Debug level details curl -v http://domain.com
Using proxy to download a file curl -x proxy.server.com:3128 download_URL
Using proxy to download a file curl -x proxy.server.com:3128 https://domain.com
Limit data transfer rate curl --limit-rate 1024B -O download_URL
Limit data transfer rate curl --limit-rate 1024B -O https://domain.com
Download file modified after a given date curl -z 1-Jan-17 download_URL
Download file modified after a given date curl -z 1-Jan-17 https://domain.com
Download file modified before a given date curl -z -1-Jan-17 download_URL
Download file modified before a given date curl -z -1-Jan-17 https://domain.com
Resume a download curl -C download_URL
Resume a download curl -C https://domain.com
Verifying SSL certificate curl --cacert new-ca.crt download_URL
Verifying SSL certificate curl --cacert new-ca.crt https://domain.com
Ignoring the ssl certificate warning curl -k download_url
Ignoring the ssl certificate warning curl -k https://domain.com


=URL syntax=
=URL syntax=