Some tips for using LFTP Tools on Linux Systems

Source: Internet
Author: User
Tags command line execution ftp openssl library linux

Lftp is a powerful download tool that supports protocol access to files: FTP, SFTP,FTPS, HTTP, https, hftp, fish. (where FTPs and HTTPS need to include the OpenSSL library at compile time). Llftp interface very want a shell: has the command complement, the history record, allows the multiple backstage task execution and so on the function, uses very conveniently. It also has features such as bookmarks, queues, mirroring, breakpoint continuation, and multiple process downloads.

Command-line Syntax

To see Lftp's command-line syntax, just enter LFTP in the shell--help

lftp [OPTS] <site>
`lftp' 是在 rc 文件执行后 lftp 执行的第一个命令
-f <file>      执行文件中的命令后退出
-c <cmd>      执行命令后退出
--help       显示帮助信息后退出
--version      显示 lftp 版本后退出
其他的选项同 `open' 命令
-e <cmd>      在选择后执行命令
-u <user>[,<pass>] 使用指定的用户名/口令进行验证
-p <port>      连接指定的端口
<site>       主机名, URL 或书签的名字

If you enter a site name on the command line, LFTP will log on to the site directly, such as

[yhj@ccse-yhj yhj]$ lftp
... ... (此处略去站点登录信息)
cd 成功,当前目录=/incoming

If you do not enter a site name at the command line, you must open it with the Open command after entering the LFTP interface

[yhj@ccse-yhj yhj]$ lftp
lftp :~> open
cd 成功,当前目录=/incoming

Related documents


Global configuration files, where the actual location relies on the system configuration file directory, possibly in/etc, or in/usr/local/etc


The user profile, which will be executed after/etc/lftp.conf, will overwrite the settings in/etc/lftp.conf.

Lftp default does not display the FTP server's welcome information and error messages, which is inconvenient in many cases, because you may want to know whether the server is not connected to the end, or the number of connections is full. If so, you can write a line in the ~/.LFTPRC.

Debug 3

You can see the error message.

More configuration options Please check the man manual or use command set-a to obtain it in the Lftp interface.


When lftp to the background non-suspend mode execution, the output is redirected here


This is where lftp stores bookmarks, and you can lftp view the bookmark command


This file is used to store the working directory of the visited sites

Common commands

Download a single file and a set of files, the breakpoint continued to be transmitted with the-C parameter

Lftp> get-c Ls-lr.txt

Lftp> mget *.txt

Mirror (upload) a directory in which multiple threads can mirror a directory in parallel (--parallel=n)

LFTP> Mirror Incoming local_name

Lftp> mirror-r Local_name

LFTP> Mirror--parallel=3 incoming Local_name

Multi-threaded download, similar to the function of network ants; default is 5 threads

Lftp> pget-n 4 ls-lr.txt

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: 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.