323
232

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 5 years have passed since last update.

cURLでHTTPステータスコードだけを取得する

Last updated at Posted at 2013-12-30

curlでHTTPステータスコードだけを取得する方法をいつも忘れるのでメモ。

$ curl -LI mazgi.com -o /dev/null -w '%{http_code}\n' -s
200

こんな感じで -w (write out)で http_code を指定しつつ、他は -o (output)で /dev/null にでも捨てる。
そして -s (silent)を指定して「進捗どうですか?」を表示しないようにする。

323
232
1

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
323
232

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?