Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a list of files that I need to download such as

meaning that i got name collision in this list of files so i need to keep the directory structure intact and recreate it while downloading this, i haven't found nothing even similar to this in the Python urllib and I don't know of any linux tool that can be good for this.

Any suggestion ?

share|improve this question
Where exactly do you see the problem doing this with bash? - I mean: mkdir files; cd files; wget; mkdir ../img/; cd ../img/ wget .... – Simon Strasser Jan 2 '13 at 11:01
@SimonStrasser at first i was trying with python, with the bash i just don't know a name for a good tool ... – user1797612 Jan 2 '13 at 11:02
up vote 1 down vote accepted

You're looking for wget - it will by default recreate the same directory structure on your localhost as on the webserver it's fetching stuff from.

share|improve this answer
thanks, wget is able to read from a text file the list of files to download ? – user1797612 Jan 2 '13 at 11:02
Yes. It's quite versatile. There's info at – Jenny D Jan 2 '13 at 11:05
wget -x -i file.txt does the trick, thanks :D – user1797612 Jan 2 '13 at 11:16

wget can do this pretty easily:

wget -x -nH

This will create the local directory files and download into it.

share|improve this answer
ok, thanks, but i was handling this starting from a text file… – user1797612 Jan 2 '13 at 11:17

Your Answer


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.