Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers 2

up vote 6 down vote accepted

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

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.