seo从业人员,有时会需求查看大量URL的返回状态码。
工具/原料
-
安装cygwin即可,模拟linux环境,使用shell
方法/步骤
-
1
测试一条url返回状态码
# curl -I -m 10 -o /dev/null -s -w %{http_code} "http://www.baidu.com/"
-
2
批量查询
# cat 1.txt|while read line;do curl -I -m 10 -o /dev/null -s -w %{http_code} $line && echo $line;done > 2.txt
把需要查询的URl放入1.txt,一行一个,utf-8格式
END
注意事项
-
txt文件是utf-8格式哦