Windows下使用wget下载文件

直接使用wget url指令,例如

1
wget https://raw.githubusercontent.com/cpm-cmake/CPM.cmake/master/cmake/get_cpm.cmake

只能得到如下输出

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
StatusCode        : 200
StatusDescription : OK
Content           : set(CPM_DOWNLOAD_VERSION 1.0.0-development-version)

                    if(CPM_SOURCE_CACHE)
                      set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
                    elseif(DEFINED ENV{CPM_SOURCE_CACHE})...
RawContent        : HTTP/1.1 200 OK
                    Connection: keep-alive
                    Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
                    Strict-Transport-Security: max-age=31536000
                    X-Content-Type-Options: nosniff
                    ...
Forms             : {}
Headers           : {[Connection, keep-alive], [Content-Security-Policy, default-src 'none'; style-src 'unsafe-inline';
                     sandbox], [Strict-Transport-Security, max-age=31536000], [X-Content-Type-Options, nosniff]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : mshtml.HTMLDocumentClass
RawContentLength  : 1079

若要保存文件,需使用

1
wget url -o file.name
Licensed under CC BY-NC-SA 4.0