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 |
You can do curl -Li mazgi.com -o /dev/null -w '%{http_code}\n' -s
-i work with post too
赞
Thanks a lot!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that the
-I
will do aHEAD
request which may get a different status code on many services than an actualGET
request.