-i 返回响应头信息后空一行再返回源码信息;
-I 仅返回响应头信息;
-v 显示详细的通信过程,连接,请求头,响应头及源码信息;
-o 自定义下载文件的文件名称
-O 使用远端服务器的文件名称
-# 使用#号显示进度;
-H 设置请求头信息
[root@zhangshou ~]# curl -v -H ‘redfadf:123456‘ http://www.baidu.com
* About to connect() to www.baidu.com port 80 (#0)
* Trying 110.242.68.3...
* Connected to www.baidu.com (110.242.68.3) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: www.baidu.com
> Accept: */*
> redfadf:123456
......
......
......
-k 不检查ssl加密的证书;
-s 静默模式,不输出任何信息(错误和进度);
root@ubuntu:~/shou# curl file:///root/shou/qqq.sh |sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 15 100 15 0 0 443k 0 --:--:-- --:--:-- --:--:-- 443k
123456789
root@ubuntu:~/shou# curl -s file:///root/shou/qqq.sh |sh
123456789
-C - 支持断点续传;
多个选项综合举例
[root@zhangshou ~]# curl --limit-rate 200k -# -o shou.mp4 http://127.0.0.1:94/mnt/workdir2/store/cdfy/202108/K202108021426051-7183A71C8BBDB20154C/0/K202108021426051-7183A71C8BBDB20154C-CH1-H0000.mp4 -C -
############# 18.5%
判断服务器是否支持断点续传
[root@zhangshou ~]# curl -I
http://127.0.0.1:94/mnt/workdir2/store/cdfy/202108/K202108021426051-7183A71C8BBDB20154C/0/K202108021426051-7183A71C8BBDB20154C-CH1-H0000.mp4
HTTP/1.1 200 OK
Server: nginx/1.14.0
Date: Tue, 03 Aug 2021 07:04:56 GMT
Content-Type: video/mp4
Content-Length: 154603883
Last-Modified: Mon, 02 Aug 2021 09:45:23 GMT
Connection: keep-alive
Control,Content-Type,Authorization
Accept-Ranges: bytes ==#有这个响应头说明支持断点续传==