##基本用法(配合
sed/
linuxjishu/13830.html target=_blank class=infotextkey>awk/grep)
$curl http://www.jb200.com
##下载保存
$curl http://www.jb200.com > index.html
$curl -o index.html http://www.jb200.com
$curl -O http://www.jb200.com/target.tar.gz
##通过代理
$curl -x 123.45.67.89:1080 -o page.html http://www.jb200.com
##保存cookie
$curl -x 123.45.67.89:1080 -o page1.html -D cookie0001.txt http://www.jb200.com
##使用cookie
$curl -x 123.45.67.89:1080 -o page1.html -D cookie0002.txt -b cookie0001.txt http://www.jb200.com
##模仿浏览器
$curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" -x 123.45.67.89:1080 -o page.html -D cookie0001.txt http://www.jb200.com
##
伪造referer
$curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" -x 123.45.67.89:1080 -e "mail.yahoo.com" -o page.html -D cookie0001.txt http://www.jb200.com
##循环下载
$curl -O http://www.jb200.com/~zzh/screen[1-10].JPG
##循环(匹配)下载
$curl -O http://www.jb200.com/~{zzh,nick}/[001-201].JPG # >like zzh/001.JPG
##循环(引用)下载
$curl -o #2_#1.jpg http://www.jb200.com/~{zzh,nick}/[001-201].JPG # like >001_zzh.jpg
##
断点续传
$curl -c -O http://cgi2.tky.3wb.ne.jp/~zzh/screen1.JPG
##分块下载
$curl -r 0 - 10240 -o "zhao.part1" http://www.jb200.com/~zzh/zhao1.mp3 &
$curl -r 10241 - 20480 -o "zhao.part1" http://www.jb200.com/~zzh/zhao1.mp3 &
$curl -r 20481 - 40960 -o "zhao.part1" http://www.jb200.com/~zzh/zhao1.mp3 &
$curl -r 40961 - -o "zhao.part1" http://www.jb200.com/~zzh/zhao1.mp3
...
$cat zhao.part* > zhao.mp3
##GET 上传
$curl http://www.yahoo.com/login.cgi?user=nickwolfe&password=12345
##POST 上传
$curl -d "user=nickwolfe&password=12345" http://www.yahoo.com/login.cgi
##POST
文件上传
$curl -F upload= $localfile -F $btn_name=$btn_value http://www.jb200.com/~zzh/up_file.cgi