wget to download files from list of urls and naming it from other list of names

I Have two text files - one of them contains urls of images that I want to download and other text file has the list of names corresponding to the urls of first files.

Example content of text file 1:

Example Content of text file 2:

ab.jpg
bc.jpg
cd.jpg

I know how to use wget command for a list of urls :

wget -i exampletextfile1.txt

Is there any way or syntax to download files from first text file using wget and name them with respect to corresponding names from other text file?

2

1 Answer

You can merge files into one using the paste tool:

paste -d "" file1.txt file2.txt > result.txt

The result of merging your examples:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like