【问题标题】:WGET - Exclude .ZIP files, while downloading the websiteWGET - 下载网站时排除 .ZIP 文件
【发布时间】:2014-01-24 11:20:11
【问题描述】:

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

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

【问题讨论】:

    标签: linux web download wget


    【解决方案1】:

    可以使用--reject参数

    wget --reject *.zip ...
    

    GNU Wget Manual (2.11 Recursive Accept/Reject Options)

    【讨论】:

      【解决方案2】:
      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. 
      

      希望这会有所帮助。

      【讨论】:

      • 第一个命令不应该是:wget -m -k -K -E -p --convert-links -e robots=off -R *.zip http://www.example.com/
      • 据我了解手册页,提供 zip,html,gif 将拒绝所有后缀为 zip,html,gif 的文件。几分钟前,我在一个小网页上尝试过。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-04-21
      • 1970-01-01
      • 2023-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多