Curl: Difference between revisions
Content added Content deleted
Line 69: | Line 69: | ||
* Save with name same as remote file |
* Save with name same as remote file |
||
curl -O |
curl -O https://domain.com/file.zip |
||
curl -O |
curl -O https://domain.com/file.zip -O https://domain.com/file2.zip |
||
* Download files securely via SSH |
* Download files securely via SSH |
||
curl -u user |
curl -u user sftp://server.domain.com/path/to/file |
||
curl -u username:password |
curl -u username:password https://domain.com |
||
* Get HTTP header information |
* Get HTTP header information |
||
curl -I |
curl -I http://domain.com |
||
* Access an FTP server |
* Access an FTP server |
||
curl |
curl ftp://ftp.domain.com --user username:password |
||
* Download a file via FTP |
* Download a file via FTP |
||
curl |
curl ftp://ftp.domain.com/file.zip --user username:password |
||
curl -u ftpuser:password -O |
curl -u ftpuser:password -O ftp://ftp_pub/public_html/index.html |
||
* Upload a file to the FTP server |
* Upload a file to the FTP server |
||
curl -T file.zip |
curl -T file.zip ftp://ftp.domain.com/ --user username:password |
||
curl -u ftpuser:password -T linuxtechi.txt |
curl -u ftpuser:password -T linuxtechi.txt ftp://ftp_pub/public_html/ |
||
* To upload multiple files to FTP server |
* To upload multiple files to FTP server |
||
curl -u ftpuser:password -T "(linuxtechi1.txt linuxtechi2.txt)" ftp://ftp_pub/public_html/ |
curl -u ftpuser:password -T "(linuxtechi1.txt linuxtechi2.txt)" ftp://ftp_pub/public_html/ |
||
* Deleting files from ftp server |
* Deleting files from ftp server |
||
curl ftp://ftp_pub/public_html -X 'DELE linuxtechi.zip' --user ftpuser:password |
curl ftp://ftp_pub/public_html -X 'DELE linuxtechi.zip' --user ftpuser:password |
||
* Handle URL redirects |
* Handle URL redirects |
||
curl -L http://domain.com |
curl -L http://domain.com |
||
* Debug level details |
* Debug level details |
||
curl -v http://domain.com |
curl -v http://domain.com |
||
* Using proxy to download a file |
* Using proxy to download a file |
||
curl -x proxy.server.com:3128 |
curl -x proxy.server.com:3128 https://domain.com |
||
* Limit data transfer rate |
* Limit data transfer rate |
||
curl --limit-rate 1024B -O |
curl --limit-rate 1024B -O https://domain.com |
||
* Download file modified after a given date |
* Download file modified after a given date |
||
curl -z 1-Jan-17 |
curl -z 1-Jan-17 https://domain.com |
||
* Download file modified before a given date |
* Download file modified before a given date |
||
curl -z -1-Jan-17 |
curl -z -1-Jan-17 https://domain.com |
||
* Resume a download |
* Resume a download |
||
curl -C |
curl -C https://domain.com |
||
* Verifying SSL certificate |
* Verifying SSL certificate |
||
curl --cacert new-ca.crt |
curl --cacert new-ca.crt https://domain.com |
||
* Ignoring the ssl certificate warning |
* Ignoring the ssl certificate warning |
||
curl -k |
curl -k https://domain.com |
||
* Getting information about supported methods |
* Getting information about supported methods |
||
curl -i -X OPTIONS http://10.107.88.68:8082 |
curl -i -X OPTIONS http://10.107.88.68:8082 |