How to download and set file names using wget -i?

I wanted to know how to determine the input file for wget, to download multiple files and set their own name for them using wget -i filename

Analog Example Using -O

 wget -O customname url 
+6
source share
1 answer

-O filename only works when you give it one URL.
With multiple URLs, all downloaded content ends with filename .

You can use while...loop :

 cat urls.txt | while read url do wget "$url" -O "${url##*/}" # <-- use custom name here done 
+6
source

Source: https://habr.com/ru/post/912149/


All Articles