0

Suppose I have various images that I want to download and I have the links available:

https://images.unsplash.com/photo-1548363585-5b1241ee3b85?ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80

https://images.unsplash.com/photo-1556648011-e01aca870a81?ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80

I don't want to type it in one by one

wget https://images.unsplash.com/photo-1548363585-5b1241ee3b85?ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80

wget https://images.unsplash.com/photo-1556648011-e01aca870a81?ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80

How can I achieve this? I have read that saving these links in a .txt file and using a for loop is not a correct way.

0

If you have the URLs in a file like this:

https://images.unsplash.com/photo-1548363585-5b1241ee3b85?ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80
https://images.unsplash.com/photo-1556648011-e01aca870a81?ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80

Then you could run

wget --input-file=file

to download the images as described by @Kusalananda.

| improve this answer | |
  • 1
    Or just use wget --input-file=somefile. – Kusalananda Apr 11 at 13:09
  • Both work flawlessly, thanx – user395980 Apr 11 at 13:12

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.