curl命令幫助


查看請求時間信息

參考:https://blog.csdn.net/jackyzhousales/article/details/82799494

更多時間參數參考 https://www.cnblogs.com/shell-blog/p/5466905.html 

示例:curl www.baidu.com -w "time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n"

更多參數參考如下

參數

含義

  

time_namelookup

DNS解析域名時間

  

time_connect

TCP連接的時間,三次握手的時間

  

time_starttransfer

從請求開始到第一個字節將要傳輸的時間

  

time_total

總時間

  

speed_download

下載速度,單位-字節每秒

  

time_appconnect

SSL|SSH等上層連接建立的時間

  

time_pretransfer

從請求開始到響應開始傳輸的時間

  

time_redirect

從開始到最后一個請求事務的時間

 

 

 

指定Header配置hosts 

curl -H 'Host:www.test.com' http://10.44.54.111/test.php

或 curl -x 10.44.54.111:80 http://www.test.com/test.php

 

Slient模式

[@localhost:~]$ curl www.baidu.com -o /tmp/bd
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2381  100  2381    0     0  84101      0 --:--:-- --:--:-- --:--:-- 85035
[@localhost:~]$ curl -s www.baidu.com -o /tmp/bd
[@localhost:~]$

 

 

顯示下載進度條信息

[@localhost:~]$ curl -# www.baidu.com -o /tmp/bd
######################################################################## 100.0%
[@localhost:~]$

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM