Server/Linux

[Linux] wget

임쟌 2023. 8. 11. 16:41

wget
curl 과 유사하지만 curl 처럼 다양한 프로토콜과 많은 기능을 지원하지 않고 파일 받는 기능에 특화되어 사용 쉽다.


1. 설치
ubuntu

sudo apt install wget

mac

brew install wget


2. 활용

(1) 다운로드

wget https://go.dev/dl/go1.20.7.darwin-arm64.tar.gz
ubuntu@dev1990 ~ $ wget https://go.dev/dl/go1.20.7.linux-amd64.tar.gz
--2023-08-11 16:13:13--  https://go.dev/dl/go1.20.7.linux-amd64.tar.gz
Resolving go.dev (go.dev)... 216.239.36.21, 216.239.34.21, 216.239.38.21, ...
Connecting to go.dev (go.dev)|216.239.36.21|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://dl.google.com/go/go1.20.7.linux-amd64.tar.gz [following]
--2023-08-11 16:13:13--  https://dl.google.com/go/go1.20.7.linux-amd64.tar.gz
Resolving dl.google.com (dl.google.com)... 142.250.206.206, 2404:6800:400a:813::200e
Connecting to dl.google.com (dl.google.com)|142.250.206.206|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 100222605 (96M) [application/x-gzip]
Saving to: ‘go1.20.7.linux-amd64.tar.gz.1’

go1.20.7.linux-amd64.tar.gz.1        100%[======================================================================>]  95.58M  49.7MB/s    in 1.9s

2023-08-11 16:13:16 (49.7 MB/s) - ‘go1.20.7.linux-amd64.tar.gz.1’ saved [100222605/100222605]

(2) 다운로드 및 다른 이름으로 저장 (go_recent_tar.gz 으로 저장)

wget -O go_recent_tar.gz https://go.dev/dl/go1.20.7.darwin-arm64.tar.gz
ubuntuubuntu@dev1990 ~ $ wget -O go_recent_tar.gz https://go.dev/dl/go1.20.7.darwin-arm64.tar.gz
--2023-08-11 16:39:44--  https://go.dev/dl/go1.20.7.darwin-arm64.tar.gz
Resolving go.dev (go.dev)... 216.239.34.21, 216.239.32.21, 216.239.36.21, ...
Connecting to go.dev (go.dev)|216.239.34.21|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://dl.google.com/go/go1.20.7.darwin-arm64.tar.gz [following]
--2023-08-11 16:39:44--  https://dl.google.com/go/go1.20.7.darwin-arm64.tar.gz
Resolving dl.google.com (dl.google.com)... 142.250.206.206, 2404:6800:400a:813::200e
Connecting to dl.google.com (dl.google.com)|142.250.206.206|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 96616124 (92M) [application/x-gzip]
Saving to: ‘go_recent_tar.gz’

go_recent_tar.gz                              100%[==============================================================================================>]  92.14M  48.4MB/s    in 1.9s

2023-08-11 16:39:47 (48.4 MB/s) - ‘go_recent_tar.gz’ saved [96616124/96616124]