title: wget download files in parallel and rename
body: <p>I have a text file with two columns: the first column is the name to be saved as, and the second column is the url address to the resource.</p>
  
  <pre><code>10000899567110806314.jpg 'http://lifestyle.inquirer.net/files/2018/07/t0724cheekee-marcopolo_1-e1532358505274-620x298.jpg'
  10001149035013559957.jpg 'https://www.politico.eu/wp-content/uploads/2018/07/GettyImages-1004567890.jpg'
  10001268622353586394.jpg 'http://www.channelnewsasia.com/image/10549912/16x9/991/529/a7afd249388308118058689b0060a978/Zv/tour-de-france-5.jpg'
  10001360495981714191.jpg 'https://media.breitbart.com/media/2018/07/Dan-Coats.jpg'
  </code></pre>
  
  <p>The file contains thousands of lines, so I wanted a quick way to download and rename these images.</p>
  
  <p>I read multiple posts on SO and came up with this solution:</p>
  
  <pre><code>cat list.txt  | xargs -n 1 -P 4 -d '\n' wget -O 
  </code></pre>
  
  <p>Which uses <code>xargs</code> to download in parallel. I want to use <code>wget</code> with <code>-O</code> option to rename the downloaded file. When I run a single <code>wget</code> command, this works well. Example:</p>
  
  <pre><code>wget -O 10000899567110806314.jpg 'http://lifestyle.inquirer.net/files/2018/07/t0724cheekee-marcopolo_1-e1532358505274-620x298.jpg'
  </code></pre>
  
  <p>but when running the command with xargs to download in parallel, I get this error:</p>
  
  <pre><code>Try `wget --help' for more options.
  wget: missing URL
  Usage: wget [OPTION]... [URL]...
  </code></pre>
  
  <p>If I generate a file with just (single col) newline delimited urls and run the following command, it works great. </p>
  
  <pre><code>cat list.txt  | xargs -n 1 -P 4 -d '\n' wget
  </code></pre>
  
  <p>But, I don't want to download the files first and then do the rename operation.</p>