如果文件不存在,则下载文件列表

rid*_*rid 13 download options wget

如果我有一个由 分隔的 URL 列表\n,是否可以传递任何选项wget来下载所有 URL 并将它们保存到当前目录,但前提是文件不存在?

anl*_*lar 18

有一个-nc( --no-clobber) 选项wget

  • 我读了这篇_after_写我的 Bash 脚本来单独检查文件的存在! (2认同)

ams*_*ams 9

来自wget --help

....
-i,  --input-file=FILE     download URLs found in local or external FILE.
....
-nc, --no-clobber          skip downloads that would download to
                           existing files.
-c,  --continue            resume getting a partially-downloaded file.
....
Run Code Online (Sandbox Code Playgroud)

我将--continue其包括在内是因为如果您尝试从中断的下载中恢复,它似乎可能会有所帮助,但您不需要它来回答您的原始问题。