通过curl获取网页当前的http状态码 操作实例如下: bbq@DESKTOP - SOR0NVK MINGW64 / d / gits / plan9 ( main ) $ curl - o / dev / null - s - w "%{http_code}" https :// plan9 . cn 200 说明: -o 输出,定向到 /dev/null -s 静默模式,不显示过程 -w 格式化输出,相关说明可通过 curl --help -w 来查看 bbq@DESKTOP - SOR0NVK MINGW64 / d / gits / plan9 ( main ) $ curl -- help - w - w , -- write - out < format > Make curl display information on stdout after a completed transfer . The format is a string that may contain plain text mixed with any number of variables . The format can be specified as a literal "string" , or you can have curl read the format from a file with "@filename" and to tell curl to read the format from stdin you write "@-" . The variables present in the output format are substituted by the value or text that curl thinks fit , as described below . Al...