Linux curl命令

参考:[url]http://www.linuxdiyf.com/linux/2800.html[/url]
[url]http://dbajun.iteye.com/blog/1813801[/url]
测试访问网页:
[zabbix@zabbix server]$ curl www.baidu.com
<!DOCTYPE html><!--STATUS OK--><html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta content="always" name="referrer">
...
...
'result_form':"#form",'result_kw':"#kw"});</script><script>if(navigator.cookieEnabled){document.cookie="NOJS=;expires=Sat, 01 Jan 2000 00:00:00 GMT";}</script></body></html>
[zabbix@zabbix server]$
路径访问:
[zabbix@zabbix server]$ curl http://donald-draper.iteye.com/admin/blogs/2316699
<html><body>You are being <a href="http://www.iteye.com/login">redirected</a>.</body></html>[zabbix@zabbix server]$

带参数:
[zabbix@zabbix server]$ curl http://192.168.126.128/zabbix/dashboard.php?sid=9422e571896006a3
<!doctype html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<title>zabbixServer: Dashboard</title>
<meta name="Author" content="Zabbix SIA" />
<meta charset="utf-8" />
<meta name="msapplication-config" content="none"/>
<link rel="shortcut icon" href="images/general/zabbix.ico" />
....
.....
hat_lastiss":{"frequency":60,"url":'?output=html',"counter":0,"darken":0,"params":{"favobj":'hat',"favref":'hat_lastiss',"favaction":'refresh'}},"hat_webovr":{"frequency":60,"url":'?output=html',"counter":0,"darken":0,"params":{"favobj":'hat',"favref":'hat_webovr',"favaction":'refresh'}},"hat_hoststat":{"frequency":60,"url":'?output=html',"counter":0,"darken":0,"params":{"favobj":'hat',"favref":'hat_hoststat',"favaction":'refresh'}}});
jqBlink.blink();
cookie.init();
chkbxRange.init();
});

// ]]></script></body>
</html>
[zabbix@zabbix server]$

测试保存网页命令
[zabbix@zabbix server]$ curl -o baidu.html www.baidu.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 99583 0 99583 0 0 31378 0 --:--:-- 0:00:03 --:--:-- 31374
[zabbix@zabbix server]$ ls -al
total 2092
-rw-rw-r-- 1 zabbix zabbix 99583 Aug 10 17:33 baidu.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值