一般[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,}" |
|手机版|小黑屋|梦想之都-俊月星空
( 粤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.