在linux的shell里访问一个URL

在linux上访问一个网址有四种方法

1.elinks,用法举例:

[weishusheng@centOS6 ~]$ elinks -dump http://www.baidu.com

2. wget 这个会将访问的首页下载到本地

[weishusheng@centOS6 ~]$ wget http://www.baidu.com
--2015-01-23 23:33:42-- http://www.baidu.com/
正在解析主机 www.baidu.com... 180.76.3.151
正在连接 www.baidu.com|180.76.3.151|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:未指定 [text/html]
正在保存至: “index.html”

[ <=> ] 89,094 258K/s in 0.3s

2015-01-23 23:33:43 (258 KB/s) - “index.html” 已保存 [89094]

[weishusheng@centOS6 ~]$ ls
acs_server easycwmp_for_arm index.html shflags-1.0.3 模板 文档 桌面
cross_easycwmp fishcorecpe rar test 视频 下载
cwmpclient freecwmp rarlinux-5.2.0.tar.gz 公共的 图片 音乐

index.html就是我们刚刚下载的。

3.curl会显示出源码

[weishusheng@centOS6 ~]$ curl http://www.baidu.com

4.lynx http://www.baidu.com

它会询问你是否允许cookies,自己选就好

原文地址:https://www.cnblogs.com/thinkinglife/p/4244380.html