LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-07-2009, 04:49 PM   #1
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Rep: Reputation: 30
Multiple File Download


I need a really simple program (or a script?) that downloads multiple files with one command.

I want to be able to enter a file name, and then download five different URLs with that file name in them. For example:

Entering "1234" would download the following files:
http://www.asdf.com/1234
http://www.sdfg.com/1234
http://www.hfdf.com/1234
http://www.hfdd.com/1234
http://www.ryte.com/1234
http://www.dtyf.com/1234
http://www.hjtt.com/1234

Does this make sense? I'm sure there's a more efficient way than to type in the wget command manually for all different URLs?

Thanks.
 
Old 10-07-2009, 05:40 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,848

Rep: Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013
A simple loop is all you should need. I believe this will work, but it's untested.

Code:
#!/bin/bash

filename="1234"
filelist="url1 url2 url3 url4 url5"

for i in $filelist; do

wget "${i}/${filename}"

done
Of course there are also a variety of download managers out there also. Probably some of them have the ability to do similar things. Try an apt-cache search or two.
 
Old 10-17-2009, 06:21 PM   #3
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Original Poster
Rep: Reputation: 30
Awesome. Thank you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ftp multiple download sunils1973 Linux - Software 2 07-05-2009 10:04 PM
multiple file download from the server in one button click Buddhike G Programming 2 06-27-2009 08:45 AM
Combine multiple one column text file into one text file with multiple colum khairilthegreat Linux - Newbie 7 11-23-2007 01:31 PM
Fast Download Site for Linux, enables >4GB Download of single file TigerLinux Linux - Distributions 9 10-29-2005 12:45 PM
Konqueror wont download download TAR,ZIP file but preview Velocide Linux - Newbie 0 03-22-2004 06:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration