Created
November 6, 2015 06:09
-
-
Save akashrajkn/45b6706c6f6fe13770df to your computer and use it in GitHub Desktop.
download large file in parts using curl in linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#This script can be used as a sort of download accelerator and also it can be used to download large files from a url in parts. | |
#Here, as an example, I've used it to download the kubuntu 15.10 version | |
#url1, url2, url3, url4 are user-defined variables | |
url1=http://d33vwem6kwnf57.cloudfront.net/kubuntu-15.10-desktop-amd64.iso | |
url2=http://d33vwem6kwnf57.cloudfront.net/kubuntu-15.10-desktop-amd64.iso | |
url3=http://d33vwem6kwnf57.cloudfront.net/kubuntu-15.10-desktop-amd64.iso | |
url4=http://d33vwem6kwnf57.cloudfront.net/kubuntu-15.10-desktop-amd64.iso | |
curl --range 0-200000000 -o kubuntu-iso.part1 $url1 & | |
curl --range 200000001-400000000 -o kubuntu-iso.part2 $url2 & | |
curl --range 400000001-600000000 -o kubuntu-iso.part3 $url3 & | |
curl --range 600000001- -o kubuntu-iso.part4 $url4 & | |
#after download, the initial iso image is now downloaded as 4 different parts, | |
#the following command can be used to join the files together | |
# $ cat kubuntu-iso.part? > kubuntu-15.10-desktop-amd64.iso |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can be used to download large files in parts (helpful if there is a file-size limit per download :P )