wget具體參數(shù)請參考 http://man.linuxde.net/wget
shell demo
# 目標(biāo)web地址
URL="http://www.baidu.com"
# 鏈接檢查并去掉詳細(xì)過程信息
RES=`wget --spider $URL -nv 2>&1`
# 對返回數(shù)據(jù)進(jìn)行過濾檢測
RES=`echo $RES | grep "404.html"`
if [[ $RES != "" ]]
then
echo "404"
else
echo "非404"
fi
exit 0