shell之curl用法笔记
来源:互联网 发布:淘宝网鱼的十字绣 编辑:程序博客网 时间:2024/04/29 19:29
基本用法(配合sed/awk/grep)
$curl http: //bpsky.net
下载保存
$curl http://bpsky.net > index.html
$curl -o index.html http://bpsky.net
$curl -O http://bpsky.net/target.tar.gz
通过代理
$curl -x 123.45 . 67.89 : 1080 -o page.html http://bpsky.net
保存cookie
$curl -x 123.45 . 67.89 : 1080 -o page1.html -D cookie0001.txt http://bpsky.net
使用cookie
$curl -x 123.45 . 67.89 : 1080 -o page1.html -D cookie0002.txt -b cookie0001.txt http://bpsky.net
模仿浏览器
$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://bpsky.net
伪造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://bpsky.net
循环下载
$curl -O http://cgi2.tky.3web.ne.jp/~zzh/screen[1-10].JPG
循环(匹配)下载
$curl -O http://cgi2.tky.3web.ne.jp/~{zzh,nick}/[001-201].JPG # >like zzh/001.JPG
循环(引用)下载
$curl -o #2_#1.jpg http://cgi2.tky.3web.ne.jp/~{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://cgi2.tky.3web.ne.jp/~zzh/zhao1.mp3 &\
$curl -r 10241 - 20480 -o "zhao.part1" http://cgi2.tky.3web.ne.jp/~zzh/zhao1.mp3 &\
$curl -r 20481 - 40960 -o "zhao.part1" http://cgi2.tky.3web.ne.jp/~zzh/zhao1.mp3 &\
$curl -r 40961 - -o "zhao.part1" http://cgi2.tky.3web.ne.jp/~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://cgi2.tky.3web.ne.jp/~zzh/up_file.cgi
$curl http: //bpsky.net
下载保存
$curl http://bpsky.net > index.html
$curl -o index.html http://bpsky.net
$curl -O http://bpsky.net/target.tar.gz
通过代理
$curl -x
保存cookie
$curl -x
使用cookie
$curl -x
模仿浏览器
$curl -A
伪造referer
$curl -A
循环下载
$curl -O http://cgi2.tky.3web.ne.jp/~zzh/screen[1-10].JPG
循环(匹配)下载
$curl -O http://cgi2.tky.3web.ne.jp/~{zzh,nick}/[001-201].JPG
循环(引用)下载
$curl -o #2_#1.jpg http://cgi2.tky.3web.ne.jp/~{zzh,nick}/[001-201].JPG # like >001_zzh.jpg
断点续传
$curl -c -O http://cgi2.tky.3wb.ne.jp/~zzh/screen1.JPG
$curl -r
$curl -r 10241 - 20480
$curl -r 20481 - 40960
$curl -r 40961 - -o
...
$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
- shell之curl用法笔记
- shell之curl用法笔记
- shell神器curl用法笔记
- curl shell 用法
- Curl学习之用法
- 学习笔记之 curl 命令用法 中文详解
- shell 脚本之 curl 请求
- 【Shell】网络利器之 curl
- shell中curl 用法详解 (二)
- 【shell学习笔记】curl命令总结
- Shell之date用法
- shell之eval用法
- Shell之date用法
- Shell之date用法
- curl用法
- Curl 用法
- Curl 用法
- Curl用法
- 可重入函数
- 消费者心理-电子书下载
- HDU 4332(状态压缩dp+矩阵连乘)
- Python之Queue模块使用心得
- cocos2dx交叉编译android时出现make: *** [obj/local/armeabi bgame.so] Error 1
- shell之curl用法笔记
- Samba是Ubuntu和Windows进行网络共享的工具,比如分享打印机,互相之间传输资料文件
- static inline int register_chrdev(unsigned int major, const char *name, const stru
- Android开发环境搭建
- MFC的picture control响应鼠标操作
- H.264 基础及 RTP 封包详解
- C++ Builder实现将SQL Server表导出为insert语句,实现表记录备份
- 拓扑排序总结
- H.264 基础及 RTP 封包详解