download - Can One Extract a Hyphenated Filename File From a Server Using Curl?

06
2014-04
  • Spackt Lad

    The images I'm dealing with have file names like part-1.jpg, object-a.jpg, Aspect-0.jpg. What I'm wondering is what I put in place of ???:

    curl -O http://server/[???].jpg

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    osx - How to download parts of the same file from different sources with curl/wget?
  • Molotoff

    I have a quite large file hosted on five different servers.

    I would like to be able to download different parts of the file from each server and subsequently concatenate the parts, in order to produce the original file.

    Is there any way to do this with curl/wget or any other OS X command-line tools?


  • Related Answers
  • xpixelz

    aria2 is the solution for multiple downloads of same file from different locations

    http://aria2.sourceforge.net/

    in your case : aria2c -s5 host1/bigfile host2/bigfile ... host5/bigfile

    better late than never...

  • Caleb Gray

    I've wanted this at least once a year for the past decade. I've taken the time to write the script; you can find the latest version here.

    Sources: https://github.com/calebgray/scripts/blob/master/usr/local/bin/download-multiple

    Just save it somewhere, make it executable, and give it a shot:

    cd /usr/bin
    curl -o download-multiple https://raw.github.com/calebgray/scripts/master/usr/local/bin/download-multiple
    chmod +x download-multiple
    ./download-multiple http://mirror.pnl.gov/releases/oneiric/ubuntu-11.10-desktop-amd64.iso http://linuxfreedom.com/ubuntu-releases/.pool/ubuntu-11.10-desktop-amd64.iso ftp://mirror.us.leaseweb.net/ubuntu-releases/oneiric/ubuntu-11.10-desktop-amd64.iso ftp://mirror.lstn.net/ubuntu-releases/oneiric/ubuntu-11.10-desktop-amd64.iso
    

    Sources

    http://curl.haxx.se/docs/manpage.html

    http://linuxandfriends.com/2008/11/01/curl-split-a-file-and-download-simultaneously-from-multiple-locations/