Lftp
From Wikipedia, the free encyclopedia
lftp | |
Author: | Alexander V. Lukyanov |
---|---|
Latest release: | 3.5.6 / October 12, 2006 |
OS: | UNIX-like |
Use: | FTP client |
License: | GNU GPL |
Website: | lftp.yar.ru |
lftp is a command-line file transfer program (FTP client) for UNIX and Unix-like systems. It was written by Alexander Lukyanov, and is made available under the GNU General Public License.
Besides FTP, it also supports FTPS, HTTP, HTTPS, HFTP, FISH, and SFTP by specifying the desired protocol in a location URL.
In addition to features common in advanced FTP clients, such as recursively mirroring entire directory trees, location bookmarks and resuming downloads, lftp also supports more advanced functionality. Transfers can be scheduled for execution at a later time, bandwidth can be throttled, transfer queues can be set up, and Unix shell-like job control is supported. The client can be fully scripted, instead of being used interactively.
Contents |
[edit] Basic usage
Basic commands for lftp (and most other command line ftp programs). To connect anonymously:
lftp ftp.example.org
To connect using a user name:
lftp username@ftpserver.org
To connect using SFTP protocol:
lftp sftp://user@server.example.org
To change current working directory:
cd dir
To list the remote directory:
ls
To list the local current directory:
!ls -l
To download aFile:
get aFile
To upload aFile:
put aFile
To get help:
help
To get help on a specific command, e.g., ls
help ls
[edit] Configuring lftp
Lftp reads its settings from two configuration files: the user specific ~/.lftp/rc and the global /etc/lftp.conf. To configure it for your own uses you need to add or edit ~/.lftp/rc. These configuration files contain commands which lftp executes on startup, typically set commands. To see available settings use set -a command.
Most settings can be made server-specific with a closure like this:
set ftp:charset/ftp.windows-server.ru windows-1251
[edit] Example of throttling bandwidth with lftp
Amongst its many features, lftp lets you limit the number of connections to the server and the amount of bandwidth to consume. E.g., to set it to open 1 connection at a maximum of 1Mb/s (given in bytes) the following can be added to ~/.lftp/rc
set net:connection-limit 1 set net:limit-rate 131072
To limit summary bandwith lftp is allowed to use:
set net:limit-total-rate 256000
[edit] Common work-arounds
If you can connect ok but everything you try to do (e.g., ls) gives you something like this:
Fatal error: SSL connect: error:00000000:lib(0):func(0):reason(0)
then you also need to explicitly turn SSL off
set ftp:ssl-allow false
On AIX: If SSL/TLS is needed, you may be able to leave SSL on and resolve the error by installing/running the random number generator (prngd) rpm.
[edit] Development history
Lftp was initially developed as part of ftpclass package (announced August 1, 1996 in relcom.tcpip). Later it has grown and become an advanced program, thus the package was renamed to lftp in February 1997. The initial goal of development was robustness, automatic resuming of transfers and increasing transfer speed by transferring parts of a file in parallel using several connections and also by protocol pipelining. A bit later mirroring capability was added.