- 浏览: 473428 次
- 性别:
- 来自: 湖南
文章分类
- 全部博客 (201)
- j2ee (43)
- oracle (9)
- mysql (7)
- db2 (1)
- j2se (3)
- spring (1)
- hibernate (3)
- struts (0)
- Berkeley DB (0)
- linux (60)
- Apache2+PHP+MYSQL (2)
- solr (15)
- svn (1)
- IntelliJ Idea (1)
- eclipse,myeclipse (4)
- ant (2)
- vim (8)
- IT生活 (4)
- 测试 (6)
- lucene (4)
- shell (1)
- nutch (18)
- thread (1)
- hadoop (5)
- mapreduce (0)
- Python (4)
- 硬件 (1)
- database (1)
- maven (1)
- 正则表达 (0)
- 互联网 (1)
最新评论
-
youngcoder:
good job
HTTP协议头部与Keep-Alive模式详解 -
javazdq:
受教了 解释的不错。
lucene创建索引高级特性和索引创建参数优化 -
josico:
有几个问题想问下楼主1. LinkedBlockingQueu ...
生产者-消费者-BlockingQueue -
annybz:
有没有关于 BlockingQueue和ConcurrentL ...
生产者-消费者-BlockingQueue -
uniquejava:
多谢,记录的很真实。
DB2 学习记录
个人技术博客:http://demi-panda.com
一、参数详解
-M/--manual | 显示全手动 |
-n/--netrc | 从netrc文件中读取用户名和密码 |
--netrc-optional | 使用 .netrc 或者 URL来覆盖-n |
--ntlm | 使用 HTTP NTLM 身份验证 |
-N/--no-buffer | 禁用缓冲输出 |
-o/--output | 把输出写到该文件中 |
-O/--remote-name | 把输出写到该文件中,保留远程文件的文件名 |
-p/--proxytunnel | 使用HTTP代理 |
--proxy-anyauth | 选择任一代理身份验证方法 |
--proxy-basic | 在代理上使用基本身份验证 |
--proxy-digest | 在代理上使用数字身份验证 |
--proxy-ntlm | 在代理上使用ntlm身份验证 |
-P/--ftp-port <address> | 使用端口地址,而不是使用PASV |
-Q/--quote <cmd> | 文件传输前,发送命令到服务器 |
-r/--range <range> | 检索来自HTTP/1.1或FTP服务器字节范围 |
--range-file | 读取(SSL)的随机文件 |
-R/--remote-time | 在本地生成文件时,保留远程文件时间 |
--retry <num> | 传输出现问题时,重试的次数 |
--retry-delay <seconds> | 传输出现问题时,设置重试间隔时间 |
--retry-max-time <seconds> | 传输出现问题时,设置最大重试时间 |
-s/--silent | 静音模式。不输出任何东西 |
-S/--show-error | 显示错误 |
--socks4 <host[:port]> | 用socks4代理给定主机和端口 |
--socks5 <host[:port]> | 用socks5代理给定主机和端口 |
-t/--telnet-option <OPT=val> | Telnet选项设置 |
--trace <file> | 对指定文件进行debug |
--trace-ascii <file> Like | 跟踪但没有hex输出 |
--trace-time | 跟踪/详细输出时,添加时间戳 |
-T/--upload-file <file> | 上传文件 |
--url <URL> | Spet URL to work with |
-u/--user <user[:password]> | 设置服务器的用户和密码 |
-U/--proxy-user <user[:password]> | 设置代理用户名和密码 |
-V/--version | 显示版本信息 |
-w/--write-out [format] | 什么输出完成后 |
-x/--proxy <host[:port]> | 在给定的端口上使用HTTP代理 |
-X/--request <command> | 指定什么命令 |
-y/--speed-time | 放弃限速所要的时间。默认为30 |
-Y/--speed-limit | 停止传输速度的限制,速度时间'秒 |
-z/--time-cond | 传送时间设置 |
-0/--http1.0 | 使用HTTP 1.0 |
-1/--tlsv1 | 使用TLSv1(SSL) |
-2/--sslv2 | 使用SSLv2的(SSL) |
-3/--sslv3 | 使用的SSLv3(SSL) |
--3p-quote | like -Q for the source URL for 3rd party transfer |
--3p-url | 使用url,进行第三方传送 |
--3p-user | 使用用户名和密码,进行第三方传送 |
-4/--ipv4 | 使用IP4 |
-6/--ipv6 | 使用IP6 |
-#/--progress-bar | 用进度条显示当前的传送状态 |
二,常用curl实例
1,抓取页面内容到一个文件中
[root@10.10.90.97 ~]#
curl -o home.html
http://www.sina.com.cn
2,用-O(大写的),后面的url要具体到某个文件,不然抓不下来。我们还可以用正则来抓取东西
[root@10.10.90.97 ~]#
curl -O
http://www.it415.com/czxt/linux/25002_3.html
3,模拟表单信息,模拟登录,保存cookie信息
[root@10.10.90.97 ~]#
curl -c ./cookie_c.txt -F log=aaaa -F pwd=******
http://blog.51yip.com/wp-login.php
4,模拟表单信息,模拟登录,保存头信息
[root@10.10.90.97 ~]#
curl -D ./cookie_D.txt -F log=aaaa -F pwd=******
http://blog.51yip.com/wp-login.php
-c(小写)产生的cookie和-D里面的cookie是不一样的。
5,使用cookie文件
[root@10.10.90.97 ~]#
curl -b ./cookie_c.txt
http://blog.51yip.com/wp-admin
6,断点续传,-C(大写的)
[root@10.10.90.97 ~]#
curl -C -O
http://www.sina.com.cn
7,传送数据,最好用登录页面测试,因为你传值过去后,curl回抓数据,你可以看到你传值有没有成功
[root@10.10.90.97 ~]#
curl -d log=aaaa
http://blog.51yip.com/wp-login.php
8,显示抓取错误
[root@10.10.90.97 ~]#
curl -f
http://www.sina.com.cn/asdf
curl: (22) The requested URL returned error: 404
[root@10.10.90.97 ~]#
curl
http://www.sina.com.cn/asdf
<HTML><HEAD><TITLE>404,not found</TITLE>
。。。。。。。。。。。。
9,伪造来源地址,有的网站会判断,请求来源地址
[root@10.10.90.97 ~]#
curl -e
http://localhost
http://www.sina.com.cn
10,当我们经常用curl去搞人家东西的时候,人家会把你的IP给屏蔽掉的,这个时候,我们可以用代理
[root@10.10.90.97 ~]#
curl -x 10.10.90.83:80 -o home.html
http://www.sina.com.cn
11,比较大的东西,我们可以分段下载
[root@10.10.90.97 ~]#
curl -r 0-100 -o img.part1
http://i2.f.itc.cn/thumb/180/bj/6018/b_60178154.jpg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 101 100 101 0 0 1926 0 --:--:-- --:--:-- --:--:-- 0
[root@10.10.90.97 ~]#
curl -r 100-200 -o img.part2
http://i2.f.itc.cn/thumb/180/bj/6018/b_60178154.jpg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 101 100 101 0 0 3498 0 --:--:-- --:--:-- --:--:-- 98k
[root@10.10.90.97 ~]#
curl -r 200- -o img.part3
http://i2.f.itc.cn/thumb/180/bj/6018/b_60178154.jpg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 13515 100 13515 0 0 154k 0 --:--:-- --:--:-- --:--:-- 280k
[root@10.10.90.97 ~]#
ll |grep img.part
-rw-r--r-- 1 root root 101 Jan 24 10:59 img.part1
-rw-r--r-- 1 root root 101 Jan 24 11:00 img.part2
-rw-r--r-- 1 root root 13515 Jan 24 11:00 img.part3
用的时候,把他们cat一下就OK了,cat img.part* >img.jpg
12,不显示下载进度信息
[root@10.10.90.97 ~]#
curl -s -o aaa.jpg
13,显示下载进度条
[root@10.10.90.97 ~]#
curl -# -O
http://www.it415.com/czxt/linux/25002_3.html
######################################################################## 100.0%
14,通过ftp下载文件
[root@10.10.90.97 ~]#
curl -u 用户名:密码 -O
http://blog.51yip.com/demo/curtain/bbstudy_files/style.css
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
101 1934 101 1934 0 0 3184 0 --:--:-- --:--:-- --:--:-- 7136
或者用下面的方式
[root@10.10.90.97 ~]#
curl -O
ftp://xukai:test@192.168.242.144:21/www/focus/enhouse/index.php
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 87518 100 87518 0 0 2312k 0 --:--:-- --:--:-- --:--:-- 11.5M
15,通过ftp上传
[root@10.10.90.97 ~]#
curl -T xukai.php
ftp://xukai:test@192.168.242.144:21/www/focus/enhouse/
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 87518 0 0 100 87518 0 2040k --:--:-- --:--:-- --:--:-- 8901k
发表评论
-
ifstat命令行统计网络流量
2012-06-05 15:31 5421关于统计网络流量的问题,我喜欢用命令行方式查看: ... -
CentOS 5: Make Command not Found
2012-05-22 17:50 1338个人博客:http://demi-panda.com ... -
Linux Deepin 安装永中 Office2012 个人版(更新)
2012-05-18 19:41 1461下面讲解如何在 Linux Deepin 上安装并使用永中 O ... -
Piwik 网站分析系统
2012-04-25 15:38 2906个人博客:http://demi-panda.com ... -
C3P0使用出错!
2012-04-18 21:43 2018个人博客:http://demi-panda.com/ ... -
win7、ubuntu11.10双系统,win7重装后,如何找回linux
2012-03-25 18:40 1340个人博客:http://demi-panda.com ... -
stardict 词库安装
2012-03-22 11:32 1438下载词库文件以后直接在目录下执行 tar -xjvf ... -
ubuntu 64位 安装 永中Office
2012-03-21 11:07 0Ubuntu 64位默认是不能安装永中Office的,因为它不 ... -
is not in the sudoers file
2012-02-15 17:23 1035解决方案: 首需要切换到root身份 $su - (注意 ... -
is not in the sudoers file
2011-12-22 14:00 945解决方案: 首需要切换到root身份 $su - (注意 ... -
进程间通信IPC、LPC、RPC
2011-05-25 15:12 2014进程间通 ... -
ubuntu下virtualbox虚拟机XP里使用USB
2011-05-19 09:25 2454环境:ubuntu10.04下安装virualbox,虚拟 ... -
Shell 判断文件类型
2011-05-11 15:45 3637#!/bin/sh ... -
Linux wget 详解
2011-05-07 16:05 4605个人技术博客:http://dem ... -
解决Socket TIME_WAIT造成的服务器无法访问,Apache的KeepAlive和TCP/IP的TIME
2011-04-20 11:19 4533个人技术博客:http://demi-panda.com ... -
Ffmpeg快速命令使用
2011-03-24 15:52 1780Ffmpeg使用语法 ffmpeg [[opt ... -
Linux远程备份工具Rsync使用案例
2011-02-24 10:31 3478个人技术博客:http://dem ... -
linux下的命令行下转换媒体格式工具FFMPEG详解
2011-02-15 17:25 6598在windows下有格式工厂之 ... -
Linux下tar bz gz等压缩包的压缩和解压
2011-02-12 12:58 1363解压 就用得挺熟 ... -
后台执行命令
2011-01-21 17:29 1402后台执行命令 当你在终端或控制台工作时,可能不希望由于运行一 ...
相关推荐
主要为大家详细介绍了Linux curl命令的相关资料,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
Linux curl命令参数详解.docx
一,curl命令参数,有好多我没有用过,也不知道翻译的对不对,如果有误的地方,还请指正。 -a/–append 上传文件时,附加到目标文件 -A/–user-agent 设置用户代理发送给服务器 - anyauth 可以使用“任何...
curl命令详解
一,curl命令参数,有好多我没有用过,如果有误的地方,还请指正。 -a/--append 上传文件时,附加到目标文件 -A/--user-agent <string> 设置用户代理发送给服务器 - anyauth 可以使用“任何”身份验证...
您可能感兴趣的文章:Linux 中 CURL常用命令详解linux下为php添加curl扩展的方法Linux下命令行cURL的10种常见用法示例linux curl命令详解及实例分享Linux中curl命令和wget命令的使用介绍与比较linux shell中curl ...
大家应该都知道在Linux中curl是一个利用URL规则在命令行下工作的文件传输工具,可以说是一款很强大的http命令行工具。它支持文件的上传和下载,是综合传输工具...本文将详细介绍Linux中的curl命令,下面来一起看看吧。
主要介绍了Linux 中 CURL常用命令详解,需要的朋友可以参考下
- Linux curl命令详解 命令:curl 在Linux中curl是一个利用URL规则在命令行下工作的文件传输工具,可以说是一款很强大的http命令行工具。它支持文件的上传
curl是一个利用URL语法在命令行下工作的文件传输工具,支持很多种http请求操作,详情可以参考Linux curl命令最全详解_Angel_CG的博客-CSDN博客_curl命令。curl现在在linux与win10都是有内置的,在命令行中可以直接...
主要给大家介绍了Linux中curl命令和wget命令使用以及这两者之间的区别比较的相关资料,curl和wget命令都是Linux下的工具,可以用来下载文件。文中介绍的非常详细,相信对大家具有一定的参考价值,需要的朋友们下面来...
Linux下模拟http的get/post请求(curl or wget)详解 背景 最近项目中需要测试接口,但是测试服务器通过堡垒机才能访问,暂时又没有通过Nginx进行转发,只好直接在Linux上模拟http请求进行测试。 方法 get请求 curl ...
开发中遇到一种问题,需要在php函数中运行Linux系统代码,所以下面这篇文章主要给大家介绍了关于php中如何执行linux命令的相关资料,文中通过示例代码介绍的非常详细,需要的朋友可以参考下
主要介绍了Linux下安装PHP curl扩展的方法,简单分析了Linux环境安装php的curl扩展具体步骤、相关命令与注意事项,需要的朋友可以参考下
Curl 纯文本格式输出: curl icanhazip.com curl ifconfig.me curl curlmyip.com curl ip.appspot.com curl ipinfo.io/ip curl ipecho.net/plain curl www.trackip.net/i curl JSON格式输出: curl ipinfo.io/...
一不小心装了一个Redis服务,开了一个全网的默认端口,一开始以为这台服务器没有公网ip,结果发现之后悔之莫及啊 某天发现cpu load高的出奇,发现一个minerd进程 占了大量cpu,google了一下,发现自己中招了 ...
kubectl trace是一个kubectl插件,可让您安排Kubernetes集群中... Linux curl -L -o kubectl-trace.tar.gz https://github.com/iovisor/kubectl-trace/releases/download/v0.1.0-rc.1/kubectl-trace_0.1.0-rc.1_linux_