When downloading a single file, we can use wget's -O
option to specify the file name. When I'm downloading Urls in a file using wget -i filelist.txt
(filelist.txt contains list Of Urls I want to Download), how can I construct filelist.txt so that each file is renamed as it is downloaded?
For Ex, if the filelist.txt contains the following content:
--output-document=1.jpg http://images2.example.com/image1.jpg
--output-document=2.jpg http://images2.example.com/image2.jpg
Is it possible to download image1.jpg
and save as 1.jpg
, image2.jpg
as 2.jpg
?
Edit
I know I can use simple script or text manipulation techniques to create multiple wget commands and each of which downloads a single Url and write to an output file. I haven't tested but this seems slower to me and I want to know if there is any way to download all the files using a single wget process.
wget
incovation, you might want to just use the filename as stored remotely, and then rename them afterward.