- [root@linux-test ~]# curl http://www.baidu.com
- <!doctype html><html><head><meta http-equiv="Content-Type" content="text/html;charset=gb2312"><title>һ֪title><style>html{overflow-y:auto}body{font:12px arial;text-align:center;background:#fff}body,p,form,ul,li{margin:0;padding:0;list-
- //...此处省略XXX字符...
- [root@linux-test ~]#
- [root@linux-test ~]# wget http://www.baidu.com
- --2011-09-16 23:05:51-- http://www.baidu.com/
- Resolving www.baidu.com... 119.75.217.56, 119.75.218.45
- Connecting to www.baidu.com|119.75.217.56|:80... connected.
- HTTP request sent, awaiting response... 200 OK
- Length: 8403 (8.2K) [text/html]
- Saving to: `index.html'
- 100%[=================================================================================================>] 8,403 --.-K/s in 0s
- 2011-09-16 23:05:51 (296 MB/s) - `index.html' saved [8403/8403]
- [root@linux-test ~]#
- [root@linux-test ~]# curl http://www.baidu.com >>baidu.html
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 100 8403 100 8403 0 0 49023 0 --:--:-- --:--:-- --:--:-- 141k
- [root@linux-test ~]# ll
- total 68
- -rw------- 1 root root 1608 Sep 16 10:16 anaconda-ks.cfg
- -rw-r--r-- 1 root root 8403 Sep 16 23:06 baidu.html
- -rw-r--r-- 1 root root 8403 Sep 16 23:05 index.html
- -rw-r--r-- 1 root root 15780 Sep 16 10:16 install.log
- -rw-r--r-- 1 root root 3779 Sep 16 10:16 install.log.syslog
- [root@linux-test ~]#
1) wget默认采用HTTP/1.0标准发送请求,而curl则默认采用HTTP/1.1发送请求。
2) 默认的User-Agent不同。
3) wget多了一个Connection: Keep-Alive头。
E.S.