![이 wget 명령이 파일을 다운로드할 수 없는 이유는 무엇입니까? [복사]](https://linux55.com/image/164604/%EC%9D%B4%20wget%20%EB%AA%85%EB%A0%B9%EC%9D%B4%20%ED%8C%8C%EC%9D%BC%EC%9D%84%20%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C%ED%95%A0%20%EC%88%98%20%EC%97%86%EB%8A%94%20%EC%9D%B4%EC%9C%A0%EB%8A%94%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F%20%5B%EB%B3%B5%EC%82%AC%5D.png)
다음 명령이 pdf 파일을 다운로드하지 않는데 브라우저 주소 표시줄에 URL을 붙여넣으면 왜 다운로드되는지 궁금합니다. (이 질문을 통해 HTTP, 웹 서비스 또는 웹 애플리케이션에 대해 알고 싶습니다.)
wget을 사용하여 PDF 파일을 다운로드하는 방법은 무엇입니까?
감사해요.
$ wget https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.99.598&rep=rep1&type=pdf
[1] 5696
[2] 5697
Redirecting output to ‘wget-log.1’.
[2]+ Done rep=rep1
$ cat wget-log
--2019-11-25 13:30:42-- https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.99.598
Resolving citeseerx.ist.psu.edu (citeseerx.ist.psu.edu)... 130.203.136.95
Connecting to citeseerx.ist.psu.edu (citeseerx.ist.psu.edu)|130.203.136.95|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5641 (5.5K) [text/html]
Saving to: ‘download?doi=10.1.1.99.598’
download?doi=10.1.1.99.598 100%[============================================================================================>] 5.51K --.-KB/s in 0s
2019-11-25 13:30:42 (453 MB/s) - ‘download?doi=10.1.1.99.598’ saved [5641/5641]
[1]+ Done wget https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.99.598
답변1
쉘이 &
URL의 문자를 해석하는 것 같지만 해당 문자에 액세스할 수 없습니다 wget
.
쉘이 전체 문자열을 하나로 처리하고 특수 문자를 해석하지 않도록 문자열을 작은따옴표로 묶어야 합니다.
wget 'https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.99.598&rep=rep1&type=pdf'