If I have a list of URLs separated by \n
, are there any options I can pass to wget
to download all the URLs and save them to the current directory, but only if the files don't already exist?
2 Answers
There is a -nc
(--no-clobber
) option for wget
.
-
2I read this after writing my Bash script to check for the existence of files individually! Jul 5, 2019 at 8:30
From 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.
....
I've included --continue
because it seemed like it might be helpful if you're trying to recover from an interrupted download, but you don't need it to answer your original question.