1 Get Return code: (only)
[[email protected] zabbix_agentd.conf.d]# curl-s--connect-timeout 20-w "%{http_code}"-o/dev/null www.baidu.com
200[[email protected] zabbix_agentd.conf.d]#
Detailed parameters
Curl
-S -s/--silent
Silent or Quiet mode. Don ' t show progress meter or error messages. Makes Curl mute.
-I.
-W-w/--write-out <format>. variables is specified as%{variable_name}
-O -o/--output <file>
2 Return header information
Curl-i http://www.baidu.com
The effect of 3-s
See if there is a-s effect: You can see the progress output of those curl
[[Email protected] scripts]# curl -s -i 192.168.100.13:80 --connect-timeout 2 | sed -n ' 1p ' http/1.1 200 ok[[email protected] scripts]# curl -I 192.168.100.13:80 --connect-timeout 2 | sed -n ' 1p ' % Total % Received % Xferd average speed time time time Current dload upload total spent left speed 0 612 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0http/1.1 200 ok
This article is from the "Tridewah operation and maintenance work Road" blog, please be sure to keep this source http://cuidehua.blog.51cto.com/5449828/1765553
Curl commands are commonly used