curlでHEAD情報のみを取得する方法を紹介します。
「curl」コマンドの「-I」オプションを使用します。
確認してみましょう。
1 2 3 4 5 6 7 8 9 10 11 12 |
# curl -I https://yahoo.co.jp; HTTP/1.1 301 Redirect Date: Sun, 09 Jan 2022 09:57:18 GMT Connection: keep-alive Server: ATS Cache-Control: no-store Location: https://www.yahoo.co.jp:443/ Content-Type: text/html Content-Language: en Content-Length: 1 # |