Skip to content

Instantly share code, notes, and snippets.

@feifei9606
Last active September 10, 2025 03:50
Show Gist options
  • Select an option

  • Save feifei9606/cd5631aacb42e088153eb18560ee163c to your computer and use it in GitHub Desktop.

Select an option

Save feifei9606/cd5631aacb42e088153eb18560ee163c to your computer and use it in GitHub Desktop.
[lftp用法] 使用lftp进行上传/下载操作 #ftp

install lftp

lftp sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)

yum install lftp

连接到ftp服务器

lftp
## 创建一个新链接
open -p <port> -u <user> <host>

下载文件

## 下载单个文件
get <file>
## 下载多个文件
mget <file1> <file2>
## 多线程下载
pget -n <thread> <file>
## 断点续传 -c
get -c <file>
## 下载整个目录
mirror -c -P <thread> <remote> <local>

上传文件

## 上传单文件
put <file>
## 上传多个文件
mput <file>
## 上传本地目录到ftp服务器
mirror -R <local> <remote>

其它常用命令

cd   #切换 FTP 目录
lcd  #切换本地目录
ls    #列出 FTP 目录文件
!ls   #列出本地目录文件
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment