1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
| Options: (H) means HTTP/HTTPS only, (F) means FTP only --compressed 请求压缩响应 (using deflate or gzip) -K, --config FILE 指定配置文件 --connect-timeout SECONDS 允许连接的最长时间 -C, --continue-at OFFSET 断点续传,如果指定为'-C -',则自动从上次中止的位置续传 -b, --cookie STRING/FILE 指定cookie (H) -c, --cookie-jar FILE 操作结束后将Cookie写入文件 (H) --create-dirs 创建必要的本地目录层次结构 --crlf 上传时将LF转换为CRLF --crlfile FILE 从给定文件中获取PEM格式的CRL列表 -d, --data DATA 提交数据 (H) --data-ascii DATA HTTP POST ASCII data (H) --data-binary DATA HTTP POST binary data (H) --data-urlencode DATA HTTP POST data url encoded (H) --delegation STRING GSS-API 授权许可 -D, --dump-header FILE 将header写入文件 -f, --fail 不显示错误输出 (H) -F, --form CONTENT 提交表单数据 (H) --form-string STRING 提交表单数据 (H) -G, --get 使用HTTP GET方式发送-d数据 (H) -g, --globoff 使用{}和[]禁用URL序列和范围 -H, --header LINE 指定header信息 (H) -I, --head 只显示响应头信息 -0, --http1.0 使用HTTP 1.0 (H) --ignore-content-length Ignore the HTTP Content-Length header -i, --include 在输出中包括响应头信息 (H/F) -k, --insecure 忽略证书访问SSL站点 (H) --interface INTERFACE 指定要使用的网络接口/地址 -4, --ipv4 使用IPv4地址 -6, --ipv6 使用IPv6地址 -j, --junk-session-cookies 忽略从文件中读取的会话cookie (H) --keepalive-time SECONDS keepalive探测的时间间隔 --limit-rate RATE 传输速度 --local-port RANGE 强制使用这些本地端口号 -L, --location 跟随重定向 (H) --location-trusted 类似-L,并发送认证到其他主机 (H) -M, --manual 显示详细的帮助 --mail-from FROM Mail from this address --mail-rcpt TO Mail to this receiver(s) --mail-auth AUTH Originator address of the original email --max-filesize BYTES 下载的最大文件大小 (H/F) --max-redirs NUM 允许的最大重定向数 (H) -m, --max-time SECONDS 允许传输的最长时间 --metalink 将给定URL作为metalink XML文件处理 -n, --netrc 读取.netrc以获取用户名和密码 --netrc-optional 使用.netrc或URL;覆盖-n --netrc-file FILE 指定netrc文件 -N, --no-buffer 禁用缓存 --no-keepalive 禁用keepalive --no-sessionid 禁用SSL session-ID (SSL) --noproxy 不使用代理服务器 --post301 在执行301重定向后不要切换到GET (H) --post302 在执行302重定向后不要切换到GET (H) --post303 在执行303重定向后不要切换到GET (H) -#, --progress-bar 显示进度条 --proto PROTOCOLS 启用/禁用指定协议 --proto-redir PROTOCOLS 在重定向时启用/禁用指定协议 -x, --proxy [PROTOCOL://]HOST[:PORT] 使用代理 --proxy-anyauth 选择任意代理身份验证 (H) --proxy-basic 在代理上使用基本身份验证 (H) --proxy-digest Use Digest authentication on the proxy (H) --proxy-negotiate 在代理上使用摘要身份验证 (H) --proxy-ntlm 在代理上使用NTLM身份验证 (H) -U, --proxy-user USER[:PASSWORD] 设置代理的用户名和密码 --proxy1.0 HOST[:PORT] 使用HTTP/1.0代理 -p, --proxytunnel 通过HTTP代理隧道进行操作 (using CONNECT) -r, --range RANGE Retrieve only the bytes within a range --raw Do HTTP "raw", without any transfer decoding (H) -e, --referer 指定Referer URL (H) -J, --remote-header-name Use the header-provided filename (H) -o, --output FILE 保存输出到指定文件 -O, --remote-name 保存输出到文件,使用远程文件名 --remote-name-all Use the remote file name for all URLs -R, --remote-time 在本地生成文件时,保留远程文件时间 -X, --request COMMAND 指定要使用的请求方法,如GET,POST,HEAD等 --resolve HOST:PORT:ADDRESS Force resolve of HOST:PORT to ADDRESS --retry NUM 重试次数 --retry-delay SECONDS 重试间隔时间 --retry-max-time SECONDS 最大重试时间 -S, --show-error 显示错误,配合-s可以在出错时显示错误信息 -s, --silent 静默模式,不显示任何输出 --socks4 HOST[:PORT] SOCKS4 proxy on given host + port --socks4a HOST[:PORT] SOCKS4a proxy on given host + port --socks5 HOST[:PORT] SOCKS5 proxy on given host + port --socks5-basic Enable username/password auth for SOCKS5 proxies --socks5-gssapi Enable GSS-API auth for SOCKS5 proxies --socks5-hostname HOST[:PORT] SOCKS5 proxy, pass host name to proxy --socks5-gssapi-service NAME SOCKS5 proxy service name for gssapi --socks5-gssapi-nec Compatibility with NEC SOCKS5 server -Y, --speed-limit RATE Stop transfers below speed-limit for 'speed-time' secs -y, --speed-time SECONDS Time for trig speed-limit abort. Defaults to 30 --stderr FILE 将标准错误输出到文件. - means stdout --tcp-nodelay Use the TCP_NODELAY option -t, --telnet-option OPT=VAL Set telnet option --tftp-blksize VALUE Set TFTP BLKSIZE option (must be >512) -z, --time-cond TIME Transfer based on a time condition --trace FILE 将调试跟踪保存到文件 --trace-ascii FILE Like --trace but without the hex output --trace-time Add time stamps to trace/verbose output --tr-encoding Request compressed transfer encoding (H) -T, --upload-file FILE 上传文件 --url URL URL to work with -B, --use-ascii Use ASCII/text transfer -u, --user USER[:PASSWORD] 指定用户名和密码 --unix-socket FILE Connect through this UNIX domain socket -A, --user-agent STRING 指定User-Agent (H) -v, --verbose 显示详情 -w, --write-out FORMAT 数据传输完成后显示的信息,FORMAT格式为%{xxx},如%{http_code},%{time_connect}等,具体变量清参考man curl帮助 --xattr Store metadata in extended file attributes -q If used as the first parameter disables .curlrc --anyauth 使用任意身份验证 (H) --basic 使用HTTP基本身份验证 (H) --digest 使用HTTP摘要身份验证 (H) --negotiate 使用HTTP协商身份验证 (H) --ntlm 使用HTTP NTLM身份验证 (H)
# SSL相关选项 --cacert FILE CA证书路径 (SSL) --capath DIR CA证书目录 (SSL) -E, --cert CERT[:PASSWD] 客户端证书文件和密码 (SSL) --cert-type TYPE 证书文件类型,可选DER/PEM/ENG (SSL) --key KEY 私钥文件 (SSL/SSH) --key-type TYPE 私钥文件类型,可选DER/PEM/ENG (SSL) --ciphers LIST 使用的SSL密码 (SSL) --egd-file FILE EGD socket path for random data (SSL) --engine ENGINGE 指定加密引擎 (SSL). "--engine list" for list --pass PASS 私钥密码 (SSL/SSH) --pubkey KEY 公钥key文件 (SSH) --hostpubmd5 MD5 主机公钥的十六进制编码MD5字符串 (SSH) --ssl Try SSL/TLS (FTP, IMAP, POP3, SMTP) --ssl-reqd Require SSL/TLS (FTP, IMAP, POP3, SMTP) -2, --sslv2 使用SSLv2 (SSL) -3, --sslv3 使用SSLv3 (SSL) --ssl-allow-beast Allow security flaw to improve interop (SSL) -1, --tlsv1 使用TLSv1 (SSL) --tlsv1.0 Use TLSv1.0 (SSL) --tlsv1.1 Use TLSv1.1 (SSL) --tlsv1.2 Use TLSv1.2 (SSL) --tlsv1.3 Use TLSv1.3 (SSL) --tls-max VERSION Use TLS up to VERSION (SSL) --tlsuser USER TLS username --tlspassword STRING TLS password --tlsauthtype STRING TLS authentication type (default SRP) --random-file FILE File for reading random data from (SSL)
# FTP相关选项 -a, --append Append to target file when uploading (F/SFTP) --disable-eprt Inhibit using EPRT or LPRT (F) --disable-epsv Inhibit using EPSV (F) --ftp-account DATA Account data string (F) --ftp-alternative-to-user COMMAND String to replace "USER [name]" (F) --ftp-create-dirs Create the remote dirs if not present (F) --ftp-method [MULTICWD/NOCWD/SINGLECWD] Control CWD usage (F) --ftp-pasv Use PASV/EPSV instead of PORT (F) -P, --ftp-port ADR Use PORT with given address instead of PASV (F) --ftp-skip-pasv-ip Skip the IP address for PASV (F) --ftp-pret Send PRET before PASV (for drftpd) (F) --ftp-ssl-ccc Send CCC after authenticating (F) --ftp-ssl-ccc-mode ACTIVE/PASSIVE Set CCC mode (F) --ftp-ssl-control Require SSL/TLS for ftp login, clear for transfer (F) -l, --list-only List only names of an FTP directory (F) -Q, --quote CMD Send command(s) to server before transfer (F/SFTP)
|