株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

「-w ‘%{http_code}\n’」オプションで取得できる。

[root@PHANTOM ~]# curl -s http://192.168.0.45 -w '%{http_code}\n' | head -10
<!DOCTYPE html>
<html lang="ja">
<head>

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-4568290130410677",
    enable_page_level_ads: true
  });
[root@PHANTOM ~]#

ステータスコードのみの場合

[root@PHANTOM ~]# curl -s http://192.168.0.45 -w '%{http_code}\n' -o /dev/null
200

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)