下載檔案清單(如果尚不存在)

下載檔案清單(如果尚不存在)

如果我有一個由 分隔的 URL 列表\n,是否可以傳遞任何選項來wget下載所有 URL 並將它們保存到當前目錄,但前提是文件尚不存在?

答案1

有一個-nc( --no-clobber) 選項wget

答案2

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.
....

我之所以將其包括在內,--continue是因為如果您嘗試從中斷的下載中恢復,它似乎可能會有所幫助,但您不需要它來回答您原來的問題。

相關內容