关于 Linux curl 命令参数

2020-12-01 08:45:20 +08:00
 zxCoder
Usage: curl [options...] <url>
     --abstract-unix-socket <path> Connect via abstract Unix domain socket
     --alt-svc <file name> Enable alt-svc with this cache file
     --anyauth       Pick any authentication method
 -a, --append        Append to target file when uploading
     --basic         Use HTTP Basic Authentication
     --cacert <file> CA certificate to verify peer against
     --capath <dir>  CA directory to verify peer against
 -E, --cert <certificate[:password]> Client certificate file and password
     --cert-status   Verify the status of the server certificate
     --cert-type <type> Certificate file type (DER/PEM/ENG)
     --ciphers <list of ciphers> SSL ciphers to use
     --compressed    Request compressed response
     --compressed-ssh Enable SSH compression
 -K, --config <file> Read config from a file
     --connect-timeout <seconds> Maximum time allowed for connection
     --connect-to <HOST1:PORT1:HOST2:PORT2> Connect to host
 -C, --continue-at <offset> Resumed transfer offset

比如-a 后面有很多个--axxxxx 是表示如果只写-a 就默认是后面刚好正对的那个--append

841 次点击
所在节点    问与答
3 条回复
IgniteWhite
2020-12-01 08:59:32 +08:00
是的,只有同一行里对应的可以用-a 简写。

建议系统了解一下 man 命令,它默认的 pager 是 less,如何使用 less 快速跳转和搜索。其他很多系统命令,比如 systemctl 和 journalctl,用的 pager 也是 less,所以学会使用和配置 less 就可以一劳永逸啦
zxCoder
2020-12-01 09:16:28 +08:00
@IgniteWhite 多谢 学到了
julyclyde
2020-12-01 12:54:26 +08:00
什么叫“很多个--axxxxx”?
-a 只对应--append 这一个
和后边--basic 没有任何关系

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/730801

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX