Script to get the HTTP status code of a list of urls?

前端 未结 8 885
无人及你
无人及你 2020-11-30 17:17

I have a list of URLS that I need to check, to see if they still work or not. I would like to write a bash script that does that for me.

I only need the returned HTT

8条回答
  •  臣服心动
    2020-11-30 18:02

    wget --spider -S "http://url/to/be/checked" 2>&1 | grep "HTTP/" | awk '{print $2}'
    

    prints only the status code for you

提交回复
热议问题