curl

打印curl总耗时

echo "time_total is %{time_total}s\n" > curl-format.txt
curl -w "@curl-format.txt" -o /dev/null -s -L http://localhost:1000/test

-w:从文件中读取打印格式

-o /dev/null:丢弃响应内容

-s:不打印进度条

输出出口公网ip

curl -s myip.ipip.net

输出服务端证书过期时间

curl -v https://www.baidu.com 2>&1 | grep "expire date"

常用参数

# 指定源端口
--local-port xxx
# 指定用户名和密码
-u "xx:xx"
# 显示调用详情
-v

 

posted on 2023-01-08 19:34  王景迁  阅读(81)  评论(0)    收藏  举报

导航