shell批量查询URL返回http状态码

测试一条url返回状态码

#  curl -I -m 10 -o /dev/null -s -w %{http_code} "http://www.baidu.com/"

shell批量查询URL返回状态码

批量查询

# cat urls.txt|while read line;do curl -I -m 10 -o /dev/null -s -w %{http_code} $line && echo $line;done > output.txt

把需要查询的URl放入urls.txt,一行一个,utf-8格式,运行后同目录下生成结果output.txt。

shell批量查询URL返回状态码

参考网址:https://jingyan.baidu.com/article/fdbd4277d59af8b89e3f4895.html

默认分类 2023-01-06 21:22:13 通过 网页 浏览(462)

共有0条评论!

发表评论

更换一道题!
放大的图片