wget에서 Curl -L 해당 명령을 사용합니까?

wget에서 Curl -L 해당 명령을 사용합니까?

시스템에 몇 가지 구멍이 생기기 때문에 이 curl명령을 전환하려고 합니다 .wgetcurl

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

wget매개변수는 무엇입니까 curl -L? 미리 감사드립니다!

답변1

이 매개변수가 없으면 wget기본 리디렉션은 다음과 같습니다.

예:

% 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]

당신은 할 수장애를 입히다--max-redirect0으로 설정하여 다음 리디렉션을 수행합니다.

% 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.

따라서 다음 리디렉션 측면에서 보면 거의 동일합니다.

얻다 곱슬
wget curl -L
wget --max-redirect=0 curl

관련 정보