curl
它是用來在linux命令行裏邊去訪問web、訪問一個網頁、訪問一個網站或是去下載一個文件。
[root@wy ~]# curl www.aming.linux
說明:這個看到的是一個html的源代碼
-I 可以省略源代碼,看它的狀態碼
[root@wy ~]# curl -I www.aming.linux
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 http://www.baidu.com
需要輸入用戶名密碼去訪問站點
格式:
[root@wy ~]# curl -u username:password http://www.baidu.com
下載一個文件-O
-o則是重命名一下