14

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?

1

2 Answers 2

21

There is a -nc (--no-clobber) option for wget.

1
  • 2
    I read this after writing my Bash script to check for the existence of files individually! Jul 5, 2019 at 8:30
11

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .