首页 > Web开发 > 详细

ubuntu 之 lftp 上传 和下载

时间:2021-08-04 22:42:21      阅读:29      评论:0      收藏:0      [点我收藏+]

1. 安装

sudo apt-get install lftp

2. 简单教程

  2.0 声明:上传或下载文件 用get 或 mget,这种方式 不包含文件夹本身,如果需要连文件夹一起上传或下载则需要使用 mirror  

  2.1 查看当前目录下有哪些东西:ls

  2.2 进入到指定目录:cd 目录

  2.3 选择文件下载的本地储存位置:lcd 本地目录

  2.4 下载文件:mget  rdir/* ldir  // 将远程目录rdir下的所有文件 下载到本地目录 ldir

  2.5 下载目录:mirror rdir ldir  // 将远程目录 rdir 下载到本地目录 ldir

  2.6 上传目录:mirror -R ldir rdir //将本地目录ldir 上传到远程目录rdir

  2.7 上传文件:mput ldir/* rdir //将本地目录ldir 下的所有文件 上传到远程目录rdir

3. 上传或下载时的一些参数

  mget 参数 远程目录/* 本地目录
  mput 参数 本地目录/* 远程目录
  mirror 同理
lftp :~> help mirror 
Usage: mirror [OPTS] [remote [local]]

Mirror specified remote directory to local directory

 -c, --continue         continue a mirror job if possible
 -e, --delete           delete files not present at remote site
     --delete-first     delete old files before transferring new ones
 -s, --allow-suid       set suid/sgid bits according to remote site
     --allow-chown      try to set owner and group on files
     --ignore-time      ignore time when deciding whether to download
 -n, --only-newer       download only newer files (-c wont work)
 -r, --no-recursion     dont go to subdirectories
 -p, --no-perms         dont set file permissions
     --no-umask         dont apply umask to file modes
 -R, --reverse          reverse mirror (put files)
 -L, --dereference      download symbolic links as files
 -N, --newer-than=SPEC  download only files newer than specified time
 -P, --parallel[=N]     download N files in parallel
 -i RX, --include RX    include matching files
 -x RX, --exclude RX    exclude matching files
                        RX is extended regular expression
 -v, --verbose[=N]      verbose operation
     --log=FILE         write lftp commands being executed to FILE
     --script=FILE      write lftp commands to FILE, but dont execute them
     --just-print, --dry-run    same as --script=-

When using -R, the first directory is local and the second is remote.
If the second directory is omitted, basename of first directory is used.
If both directories are omitted, current local and remote directories are used.

  

ubuntu 之 lftp 上传 和下载

原文:https://www.cnblogs.com/taotao0805/p/15100562.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!