Skip to content

Instantly share code, notes, and snippets.

@drobune
Created December 12, 2014 07:11
Show Gist options
  • Save drobune/e03d64ef7ba02864781a to your computer and use it in GitHub Desktop.
Save drobune/e03d64ef7ba02864781a to your computer and use it in GitHub Desktop.
get only status code on curl
curl -LI mazgi.com -o /dev/null -w '%{http_code}\n' -s
@espoelstra
Copy link

Note that the -I will do a HEAD request which may get a different status code on many services than an actual GET request.

@james4388
Copy link

You can do curl -Li mazgi.com -o /dev/null -w '%{http_code}\n' -s
-i work with post too

Copy link

ghost commented Apr 15, 2020

@kiraSanti
Copy link

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment