Curl commands are commonly used

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.