I am using Terminal to wget images from a list of urls in a text file, using the command: wget -i septweetsimages.csv.

When the operation hits url and can't connect to its server, Terminal continues in an infinite loop to try to connect, prompting the following result:

"Connecting to wtim.es (wtim.es)||:80... failed: Operation timed out.

How can I get the process to continue on to the next url in the list after say 2 failed connections?

  • 1
    Welcome to Ask Different! :) Can I ask you to edit your question to include the actual syntax of the command you're using to perform the operation? Without that it's hard to know what you're already trying?
    – Monomeeth
    Aug 2, 2018 at 3:17

2 Answers 2


Please run "man wget" in Terminal and view the description for the option "--tries". Example shown includes "--tries=10".


Below is an example syntax for how you can manage this:

wget --tries 10 --waitretry=30 -—wait=20 --random-wait -—referer="" -i septweetsimages.csv

In the above syntax, if wget encounters a failure, it'll retry 10 times with a waiting period between each attempt of 30 seconds. It also waits up to 20 seconds before downloading each new image.

Using the man wget command in terminal will provide a description of many other options you can use to manage bandwidth, capture a log file, etc.

You must log in to answer this question.

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