lftp is a sophisticated ftp client that implements the following features:
- Handles different protocols: ftp, ftps, sftp, http, hftp, fish and bittorrent (https and ftps protocols will be available only if lftp was compiled with GNU TLS or OpenSSL libraries).
- Every operation is reliable, that is any non-fatal error is handled properly and the operation is repeated, for example if a downloading breaks, it will be restarted from where it was, even if the ftp server does not support REST command, lftp will try to retrieve the file from the beginning until the download is completed.
- It allows you to run tasks in the background (&).
- It allows grouping commands using parentheses and launches them in background.
- You can put a command in background using Ctrl-z an get it back with the wait or fg command (fg an alias for wait).
- Listing running jobs, through command jobs.
- Commands can be executed conditionally based on termination status of previous command (&&, ||).
- Autocomplete using Tab key, similar to bash.
- If you exit lftp when some jobs are not finished yet, lftp will move itself to nohup mode in background.
- It allows you to update, upload or download a full directory through the mirror option.
- With the command at you can schedule tasks.
- The command queue allows you to queue commands for sequential execution.
lftp reads configuration directives from /etc/lftp.conf, ~/.lftprc and ~/.lftp/rc where you can put aliases and set commands.
Connect to a public ftp site
$ lftp ftp://openbsd.cs.toronto.edu $ lftp > open openbsd.cs.toronto.edu
Connect to a restricted ftp site
There are several ways to connect to a restricted ftp site, here are 4 of them. If you not specify the password, lftp will request it (recommended method)
$ lftp user[:password]@ftp.mysite.com $ lftp ftp.mysiteftp.com > user username [password] $ lftp > open ftp.mysite.com > user username [password] $ lftp > open username[:password]@ftp.mysite.com
List the remote content
List local content
Show current remote URL
Show current local working directory
Change remote directory
> cd remote-dirname
Change local directory
> lcd local-dirname