0

I'm trying to switch this curl command to wget because curl is posing some vulnerability to the system.

curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-static-amd64

What is wget parameter equivalent to curl -L? Thanks in advance!

1 Answer 1

3

There is no such parameter, as wget follows redirects by default.

Example:

% wget --verbose https://google.com --output-document=/dev/null
--2022-12-06 15:40:20--  https://google.com/
Resolving google.com (google.com)... 216.58.220.110
Connecting to google.com (google.com)|216.58.220.110|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.google.com/ [following]
--2022-12-06 15:40:20--  https://www.google.com/
Resolving www.google.com (www.google.com)... 142.251.42.164
Connecting to www.google.com (www.google.com)|142.251.42.164|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘/dev/null’

/dev/null                                     [ <=>                                                                                ]  14.82K  --.-KB/s    in 0s

2022-12-06 15:40:20 (49.4 MB/s) - ‘/dev/null’ saved [15179]

You can disable following redirects by setting --max-redirect to 0:

% wget --verbose https://google.com --output-document=/dev/null --max-redirect=0
--2022-12-06 15:41:00--  https://google.com/
Resolving google.com (google.com)... 216.58.220.110
Connecting to google.com (google.com)|216.58.220.110|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.google.com/ [following]
0 redirections exceeded.

So these are roughly equivalent in terms of following redirects:

Wget curl
wget curl -L
wget --max-redirect=0 curl

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .