curl www.baidu.com ;;list on the screen
curl -o bd.html www.baidu.com ;;keep html code in the file "bd.html"
curl -x 123.45.67.89:1080 bd.html www.baidu.com ;;with proxy
curl -x 123.45.67.89:1080 -o bd.html -D cookie0001.txt www.baidu.com ;;with keep session
curl -x 123.45.67.89:1080 -o bd2.html -D cookie0002.txt -b cookie0001.txt www.baidu.com ;;with read session and keep session again
;;with client infomation
curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" -x 123.45.67.89:1080 -o bd.html -D cookie0001.txt www.baidu.com
;;visit "mail.baidu.com" with the click from "www.baidu.com"
curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" -x 123.45.67.89:1080 -e "mail.baidu.com" -o bd.html -D cookie0001.txt www.baidu.com
curl -O http://www.baidu.com/logo.jpg ;;get the file
curl -O http://www.baidu.com/logo[1-10].jpg ;;get the file logo1.jpg~logo10.jpg
curl -o #2_#1.jpg http://{img3,img5}.baidu.com/logo[1-10].jpg ;;get img3 and img5 logo1.jpg~logo10.jpg,total 10 files.
curl -c -O http://www.baidu.com/logo.jpg ;;get the file is stoped
curl -u name:passwd ftp://ip:port/path/file ;;ftp download
curl http://www.baidu.com/login.cgi?user=nickwolfe&password=12345 ;;get send data
curl -d "user=11111&password=66666" http://www.baidu.com/login.cgi ;;post send data
curl dict://dict.org/d:computer ;;dict words
i参数可以显示http response的头信息,连同网页代码一起。
-v参数可以显示一次http通信的整个过程,包括端口连接和http request头信息。
curl --trace output.txt www.baidu.com
curl --trace-ascii output.txt www.baidu.com
OM_curl
最新推荐文章于 2024-09-16 18:37:45 发布