Basic usage (with Sed/awk/grep)
Print output to standard output (STDOUT) by default
$curl http://www.baidu.com
Download Save:
Save the downloaded file to the specified file with the-o/-o option:
-O: Save the file as the file name specified on the command line
-O: Save the file to local using the default file name in the URL
Direct output Save $curl http://www.baidu.com > index.html Save in current directory and name $curl-o index.html http://www.baidu.com Specify path/home and name $curl -o/home/index.html http://www.baidu.com Save in the current directory using the default file name $curl-o http://www.baidu.com/target.tar.gz
Set up a proxy for curl
-X option to add agent functionality to curl
Specify the proxy host and port curl-x proxysever.test.com:3128 http://google.com or curl-x 192.168.1.100:3128 http://google.com
Saving and using Web site cookie information
Save cookies from the website to the Cookies.txt file curl-d cookies.txt http://localhost/index.php Use the last saved cookie information curl-b Cookies.txt http ://localhost/index.php
Let's do it.
This article is from the "Big Meow Downhill" blog, please make sure to keep this source http://damiao.blog.51cto.com/8194496/1913720
Curl Usage Notes