curl www.baidu.com会看到很多乱码文件,其实就是html文件
curl -I www.baidu.com会看到状态
[root@master ~]# curl -I www.lishiming.net(这里301表示跳转)
HTTP/1.1 301 Moved Permanently
Server: nginx/1.0.15
Connection: keep-alive
Date: Tue, 21 Jul 2015 12:27:06 GMT
Content-Type: text/html
Content-Length: 185
Location: http://www.apelearn.com/bbs/forum.php
X-Upstream-Echo-Time: 88
[root@master ~]# curl -x182.254.8.146:80 www.qq.com -I(-x表示指定一个代理)
HTTP/1.1 200 OK
Server: squid/3.4.1
Date: Tue, 21 Jul 2015 12:31:32 GMT
Content-Type: text/html; charset=GB2312
Connection: keep-alive
Vary: Accept-Encoding
Vary: Accept-Encoding
Expires: Tue, 21 Jul 2015 12:32:32 GMT
Cache-Control: max-age=60
Vary: Accept-Encoding
Vary: Accept-Encoding
X-Cache: HIT from shanghai.qq.com
curl -TV www.qq.com可以看访问过程
[root@master ~]# curl -u username:password http://www.qq.com
[root@master ~]# curl -O https://www.baidu.com/img/bd_logo1.png(下载一个图片)
[root@master ~]# curl -o baidu.png https://www.baidu.com/img/bd_logo1.png(下载并且重命名)