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 |