GNU Wget 是一款用于非交互式地从网络下载文件的免费命令行程序。
本文提供了最新版本的 wget 和 wget2 命令,适用于 Windows 的 x86_64 系统。
1. 版本以及截图
Wget 版本 1.25.0
GNU Wget 1.25.0 built on mingw32.
-cares +digest -gpgme +https +ipv6 +iri +large-file -metalink +nls
+ntlm +opie -psl +ssl/gnutls
Wgetrc:
D:/a/msys64/mingw64/etc/wgetrc (system)
Locale:
D:/a/msys64/mingw64/share/locale
Compile:
gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/mingw64/etc/wgetrc"
-DLOCALEDIR="/mingw64/share/locale" -I. -I../../wget-1.25.0/src
-I../lib -I../../wget-1.25.0/lib -I/mingw64/include
-ID:/a/msys64/mingw64/include/p11-kit-1 -DHAVE_LIBGNUTLS -DNDEBUG
-march=nocona -msahf -mtune=generic -O2 -pipe
-Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong
-Wp,-D__USE_MINGW_ANSI_STDIO=1
Link:
gcc -ID:/a/msys64/mingw64/include/p11-kit-1 -DHAVE_LIBGNUTLS
-DNDEBUG -march=nocona -msahf -mtune=generic -O2 -pipe
-Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong
-Wp,-D__USE_MINGW_ANSI_STDIO=1 -lpcre2-8 -lidn2 -lnettle -lgnutls
-lz -lbcrypt -lws2_32 ../lib/libgnu.a -lws2_32 -lbcrypt -lws2_32
-lws2_32 -lws2_32 /mingw64/lib/libiconv.dll.a -L/mingw64/lib
/mingw64/lib/libintl.dll.a -L/mingw64/lib
/mingw64/lib/libunistring.dll.a -L/mingw64/lib -lws2_32 -lws2_32
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://www.gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Originally written by Hrvoje Niksic <[email protected]>.
Please send bug reports and questions to <[email protected]>.
Wget2 版本 2.2.1
GNU Wget2 2.2.1 - multithreaded metalink/file/website downloader +digest +https +ssl/gnutls +ipv6 +iri +large-file +nls -ntlm -opie +psl -hsts +iconv +idn2 +zlib +lzma +brotlidec +zstd +bzip2 -lzip +http2 -gpgme Copyright (C) 2012-2015 Tim Ruehsen Copyright (C) 2015-2024 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://www.gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please send bug reports and questions to <[email protected]>.
截图如下:

2. 下载已经编译好的二进制文件
下载地址:
https://dl.lamp.sh/files/wget.zip
文件 wget.zip 的属性
md5sum: 69924d5c70ab116f75c3b2e7f64345d3
sha1sum: 959ce6b6fb6f5ac9711c296d03d6b7817331dc1e
sha256sum: 661dd25e130725eceed38db36a1c947ef111eb295c5d12712143092b3e3d7a9c

下载完成,直接解压到任意目录下,即可在 PowerShell 里使用。
解压到指定目录,比如:C:\Program Files\wget 后,将该目录设置到系统环境变量里,这样即可在 PowerShell 里直接使用。

需要注意的是,由于 PowerShell 里默认会把 Invoke-WebRequest 命令软链接为 wget 使用,所以即使设置到环境变量里,默认情况下 wget 不会被调用。
此时需要配置一下默认的 $Profile 文件。打开 PowerShell,输入:
Test-path $Profile
显示为 False 时,则继续输入:
New-Item –Path $Profile –Type File –Force
创建当前用户的 PowerShell 配置文件。然后用系统自带的记事本打开该配置文件:
notepad $Profile
在打开的记事本窗口中,输入以下内容:
Remove-Item alias:wget
然后保存并关闭记事本。
设置一下 ExecutionPolicy:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
完成后关闭当前的 PowerShell 窗口。
重新打开 PowerShell,输入 Get-Command wget即可显示 wget 位于的绝对路径。
3. 下载 Wget 的使用手册
下载地址:
https://teddysun.com/wp-content/uploads/2026/wget.pdf
写在最后
请关注我的 Telegram 频道:https://t.me/qiushuiyibing
我会在此不定期发布一些杂七杂八的作品。
同时也欢迎加入交流群:https://t.me/qiushui2018
转载请注明:秋水逸冰 » Wget for Windows
