Home‎ > ‎Server config‎ > ‎

lftp Example

How to use lftp as download accelerator

lftp has pget command. It allows you download files in parallel. The syntax is
lftp -e 'pget -n NUM -c url; exit'
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 -c http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.2.tar.bz2'

Sample outputs:

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

Where,

  1. pget – Download files in parallel
  2. -n 5 – Set maximum number of connections to 5
  3. -c – Continue broken transfer if lfile.lftp-pget-status exists in the current directory

How to use lftp to accelerate ftp/https download on Linux/Unix

Another try with added exit command:
$ lftp -e 'pget -n 10 -c https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.15.tar.xz; exit'