京东6.18大促主会场领京享红包更优惠

 找回密码
 立即注册

QQ登录

只需一步,快速开始

wget url获取200返回值

2018-12-27 10:15| 发布者: zhaojun917| 查看: 1028| 评论: 0|原作者: 梦想之都-俊月星空

摘要: 一般# wget 192.168.152.5 --spider|grep 200会出现下面情况Spider mode enabled. Check if remote file exists.–2018-11-03 09:03:46-- http://192.168.152.5/Connecting to 192.168.152.5:80… connected.HTTP re ...
一般[root@lamp scripts]# wget 192.168.152.5 --spider|grep 200会出现下面情况
Spider mode enabled. Check if remote file exists.
–2018-11-03 09:03:46-- http://192.168.152.5/
Connecting to 192.168.152.5:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 23 [text/html]
Remote file exists and could contain further links,
but recursion is disabled – not retrieving.
如何取到我们要的返回值“200”行呢,须在wget后加上2>&1
[root@lamp scripts]# wget 192.168.152.5 2>&1|grep 200
HTTP request sent, awaiting response… 200 OK
--------------------- 

wget http://11.php --spider 2>&1 | grep "HTTP" | grep -Eo "[0-9]{1,}"
关闭

站长推荐上一条 /6 下一条

QQ|手机版|小黑屋|梦想之都-俊月星空 ( 粤ICP备18056059号 )|网站地图

GMT+8, 2025-7-1 19:13 , Processed in 0.032967 second(s), 19 queries .

Powered by Mxzdjyxk! X3.5

© 2001-2025 Discuz! Team.

返回顶部