About nixCraft

Topics

lftp to accelerate ftp / http download speed under Linux and UNIX

Posted by Vivek Gite [Last updated: August 10, 2007]

lftp is a file transfer program that allows sophisticated ftp, http and other connections to other hosts. If site is specified then lftp will connect to that site otherwise a connection has to be established with the open command. This is an essential tool for all a Linux admin. I've already written about Linux ultra fast command line download accelerator such as Axel and prozilla. lftp is another tool for same job with more features.

lftp can handle seven file access methods :
=> ftp
=> ftps
=> http
=> https
=> hftp
=> fish
=> sftp
=> file

So what's special about lftp?

Use lftp as download accelerator

lftp has pget command. It allows you download files in parallel. lftp pget command syntax:
lftp -e 'pget -n 5 ftp://path/to/file'

For example, download http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.2.tar.bz2 file using pget in 5 parts:
$ cd /tmp
$ lftp -e 'pget -n 5 http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.2.tar.bz2'

Output:

45108964 bytes transferred in 57 seconds (775.3K/s)
lftp :~>quit

A note about parallel downloading

Please note that by using download accelerator you are going to put a load on remote host. Also note that lftp may not work with sites that do not support multi-source downloads or blocks such requests at firewall level.

lftp command offers many other features. Refer to lftp man page for more information:
man lftp

Tell us how we're doing: Please answer a few questions about your experience to help us improve nixCraft.

You may also be interested in other helpful articles:

Discussion on This Article:

  1. Terry Rankine Says:

    Since we are all lazy people, put the quit in the -e command.


    lftp -e 'pget -n 5 http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.2.tar.bz2;quit

  2. vivek Says:

    Terry,

    Heh nice, I just forgot to add quit.

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , ,

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.