curl
它是用来在linux命令行里边去访问web、访问一个网页、访问一个网站或是去下载一个文件。
[root@wy ~]# curl
说明:这个看到的是一个html的源代码
-I 可以省略源代码,看它的状态码
[root@wy ~]# curl -I
HTTP/1.1 200 OK
Server: nginx/1.10.1
Date: Mon, 03 Oct 2016 08:57:35 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/5.6.22
常见状态码:200(成功),301(域名跳转),302,404,403,502,503
-x代理
查看访问过程-v
[root@wy ~]# curl -Iv
需要输入用户名密码去访问站点
格式:
[root@wy ~]# curl -u username:password
下载一个文件-O
-o则是重命名一下