我正在尝试切换此curl
命令,wget
因为curl
它会给系统带来一些漏洞。
curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-static-amd64
Run Code Online (Sandbox Code Playgroud)
wget
参数相当于什么curl -L
?提前致谢!
没有这个参数,默认wget
重定向如下。
例子:
\n% wget --verbose https://google.com --output-document=/dev/null\n--2022-12-06 15:40:20-- https://google.com/\nResolving google.com (google.com)... 216.58.220.110\nConnecting to google.com (google.com)|216.58.220.110|:443... connected.\nHTTP request sent, awaiting response... 301 Moved Permanently\nLocation: https://www.google.com/ [following]\n--2022-12-06 15:40:20-- https://www.google.com/\nResolving www.google.com (www.google.com)... 142.251.42.164\nConnecting to www.google.com (www.google.com)|142.251.42.164|:443... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: unspecified [text/html]\nSaving to: \xe2\x80\x98/dev/null\xe2\x80\x99\n\n/dev/null [ <=> ] 14.82K --.-KB/s in 0s\n\n2022-12-06 15:40:20 (49.4 MB/s) - \xe2\x80\x98/dev/null\xe2\x80\x99 saved [15179]\n
Run Code Online (Sandbox Code Playgroud)\n您可以通过设置为 0 来禁用以下重定向:--max-redirect
% wget --verbose https://google.com --output-document=/dev/null --max-redirect=0\n--2022-12-06 15:41:00-- https://google.com/\nResolving google.com (google.com)... 216.58.220.110\nConnecting to google.com (google.com)|216.58.220.110|:443... connected.\nHTTP request sent, awaiting response... 301 Moved Permanently\nLocation: https://www.google.com/ [following]\n0 redirections exceeded.\n
Run Code Online (Sandbox Code Playgroud)\n因此,就以下重定向而言,这些大致相同:
\n获取 | 卷曲 |
---|---|
wget | curl -L |
wget --max-redirect=0 | curl |
归档时间: |
|
查看次数: |
1387 次 |
最近记录: |