WGET - 在下载网站时排除.ZIP文件

时间:2014-01-24 11:20:12

标签: linux web download wget

我正在使用wget下载一个完整的网站。我想知道如何修改此终端命令,以便它排除/跳过/不下载任何.zip文件。

wget -m -k -K -E -p --convert-links -e robots=off http://www.example.com/

2 个答案:

答案 0 :(得分:2)

您可以使用--reject参数

wget --reject *.zip ...

GNU Wget Manual (2.11 Recursive Accept/Reject Options)

答案 1 :(得分:1)

wget -m -k -K -E -p --convert-links -e robots=off -R zip http://www.example.com/ 

从GNU的Wget联机帮助页中获取此信息:

‘-R rejlist --reject rejlist’
    Specify comma-separated lists of file name suffixes or patterns to accept or reject (see Types of Files). Note that if any of the wildcard characters, ‘*’, ‘?’, ‘[’ or ‘]’, appear in an element of acclist or rejlist, it will be treated as a pattern, rather than a suffix. 

希望这有帮助。