5 ms·
This is more SysAdmin related, but one power-curl function I use atleast 30 times a day is this alias I have in my .bash_aliases This will output the HTTP stat
by UI_at_80x24 7y ago
This is more SysAdmin related, but one power-curl function I use atleast 30 times a day is this alias I have in my .bash_aliases
This will output the HTTP status code for a given URL.
alias hstat="curl -o /dev/null --silent --head --write-out '%{http_code}\n'" $1
Example:
$ hstat google.com
301
I also use curl as an 'uptime monitor' by adding onto that code section. (a file with a list of URLs, and "if http status code !=200" then email me.)
There are variations on this all over the place but I really depend on it and I like it.