Powerful download tool curl

Source: Internet
Author: User
Article Title: Super Powerful download tool curl. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Author: pk
Mandrake Linux 9.1 is coming to us. I can't wait. Let's take a look at the iso file of rc2, but since I have limited access to the Internet, I just want to download the ISO file. However, the Flash get nt download in linux is not fast enough.
  
When downloading large files such as iso from a website, even if the peer can provide a download rate of 1 Mbit/s, the waiting process is also worrying, linux does not seem to have any mature multi-thread download tools. Even some well-known software in Windows has no way to use a site with "only one connection per IP address. The new FlashGet 1.3 supports different proxies for each download thread. In fact, you can split multiple parts from large files under that stingy site at the same time.
  
However, this does not take into account the redundant backup feature of ftp sites today: the same iso may have images on multiple sites. can we take advantage of this feature?
  
We use the super powerful download tool curl, which does not seem to be multi-threaded, but we use shell to control multiple processes to work together. If you have never used this tool, install it as follows:
Code:
  
# Rpm-q curl
# Curl-7.9.4-4mdk
  
The following describes how to use the first iso file downloaded from Mandrake Linux 9.1 rc2. After collection, three available addresses are found, marked as url1 ~ Url3.
Code:
  
# Cat 1.sh
#! /Bin/bash
Url1 = ftp://mirrors.kernel.org/mandrake-iso/i586/
MandrakeLinux-9.1rc2-CD1.i586.iso
Url2 = ftp://mandrake.redbox.cz/Mandrake-iso/i586/MandrakeLinux-9.1rc2-CD1.i586.iso
Url3 = ftp://ftp.uninett.no/pub/linux/Mandrake/Mandrake-iso/i586/
MandrakeLinux-9.1rc2-CD1.i586.iso
Curl-r 0-199999999-o inst.1 $ url1 &
Curl-r 200000000-399999999-o inst.2 $ url2 &
Curl-r 400000000-o inst.3 $ url3 &
Echo "TODO: cat inst.2> inst.1; cat inst.3> inst.1"
Echo "THEN: mv inst.1 MandrakeLinux-9.1rc2-CD1.i586.iso"
  
The above commands should be easy to understand. After executing the command, I quickly got three file fragments. if the download is complete, what you see in the current directory is inst. [1, 3] The three files may not be combined yet. you can merge them.
Code:
  
Cat inst.2> inst.1
Cat inst.3> inst.1
Music inst.1 MandrakeLinux-9.1rc2-CD1.i586.iso
  
After splicing, calculate the md5 value,
Code:
Md5sum MandrakeLinux-9.1rc2-CD1.i586.iso
342862f7a2da34b6d9d772d6bdf91b4d
  
Haha, the hash value is consistent with their. Done
  
Of course, if your network is fast enough, there is no need to do so, but I still like it. Well, of course, you can get more details, for example, you can divide the download into five sections, corresponding to different ftp, you can modify the Shell Script above. For detailed use of curl, you should look at its Man page.
  
Haha, I only downloaded the first iso file of Mandrake linux 9.1rc. I also tested and installed it. I feel that the Chinese font in the file is still very rough. However, it is okay for others. If you want to play the game, you can play it again when the official version comes out.
Haha, in fact, it's not just that Mandrkae can do this, but other release versions are the same. you just need to find several ftp. At the same time, a solution for downloading large iso files is also available. Cool, curl, and cool powerful download tool.
  
Note: for details about this article, refer to curl, a big talk download tool, on the BBS site of HKUST of China. "
  
  
  
  
  
  
  
  
  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.