Created
December 12, 2014 07:11
-
-
Save drobune/e03d64ef7ba02864781a to your computer and use it in GitHub Desktop.
get only status code on curl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -LI mazgi.com -o /dev/null -w '%{http_code}\n' -s |
赞
Thanks a lot!
-I
outputs headers. -X HEAD
changes method and keep outputs body (=nothing). so you can omit -o
part like this
curl -X HEAD -sw '%{http_code}\n' example.com
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can do
curl -Li mazgi.com -o /dev/null -w '%{http_code}\n' -s
-i work with post too