0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

urlのステータス一括チェック

Posted at

urlのステータス一括チェック

背景

web開発で対象urlをチェックする必要があったのですが、対象が50パターン程あって1つずつurlを実行するのは凄く時間がかかるので一括で出来る様にしました。

コマンド

対象urlをurl_list.txtに記載している前提です。
1行ずつループしてcurlのステータスを取得しています。
最後にechoでurlとステータスをセットで表示しています。

for url in `cat url_list.txt`; do curl -s -o /dev/null -w '%{http_code}' $url | xargs -I {} echo $url {}; sleep 1;done
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?