一、
curl -Hhost:域名 http://*.*.*.*/接口路径
https加 -k curl -k -Hhost:
*.*.*.* 为ip地址,-H 即 把域名解析到ip地址上
count=0; while [ true ]; do count=`expr $count + 1`; sleep 0.5; curl -o /dev/null -s -w "$count. - $(date "+%Y-%m-%d %H:%M:%S") - %{time_namelookup} - %{time_connect} - %{time_appconnect} - %{time_starttransfer} - %{speed_download} - %{time_total} - %{http_code}\n" '域名或接口地址' ; done
二、curl -o /dev/null -s -w 'DNS解析时长:%{time_namelookup}\n建立tcp时长:%{time_connect}\n客户端到服务器时长:%{time_starttransfer}\n从开始到结束时长:%{time_total}\n下载速度:%{speed_download}\n' 域名或接口地址