如何处理 wget 中的相似名称?

How to handle similar names in wget?

我正在下载如此多的图片,以至于它们的链接都在一个文件中,命令如下:

wget -i file.txt

我怀疑许多文件可能同名。所以我担心他们会被覆盖。有没有办法让 wget 为文件设置顺序名称或以任何其他方式处理类似的名称?

对于 wget 1.19.1,您正在寻找的是默认行为。当找到匹配的文件时,具有相同名称的文件将被编号。

假设 file.txt 看起来像:

http://www.apple.com
http://www.apple.com
http://www.apple.com
http://www.apple.com

wget -i file.txt 的输出将是四个文件,命名为:

index.html
index.html.1
index.html.2
index.html.3