lftp

Besides FTP, it also supports FTPS, HTTP, HTTPS, HFTP, FISH, and SFTP by specifying the desired protocol in a location URL.

相關網站

support files

/etc/lftp.conf
the global configuration file (run first)
~/.lftp/rc, ~/.lftprc
the per-user configuration file (run second; overrides global file)
~/.lftp/cwd_history
stores the last cwd per site
~/.lftp/rl_history
stores all used commands
~/.lftp/bookmarks
bookmarks

.lftprc

 debug 3
 #set ftp:passtive-mode no
 #alias utf8 " set ftp:charset UTF-8"
 #alias Big5 " set ftp:charset Big5"
 

bookmarks

lftp> bookmark add 123
lftp> bookmark edit
lftp> open 123
lftp> bookmark list
lftp> help bookmark

登入伺服器

$ lftp user@site:port

其他方法

$ lftp ftp://user:password@site:port
$ lftp user:password@site:port
$ lftp site -p port -u user,password
$ lftp site:port -u user,password

常用命令

下載目錄

lftp> mget -d dirname/*

lftp> mirror dirname

上傳目錄

lftp> mput -d dirname/*

lftp> mirror -R dirname

搜索

lftp> ls -R | grep .css

lftp> find -d 3 | grep .css

抓檔

get/mget/pget

上傳

put/mput/

刪除目錄內容和目錄

lftp> rm -r

mirror

 mirror [OPTS] [remote [local]]

-c 續傳
-e 比較遠端和本地端的檔案,如果遠端沒有的檔案,就將本地端的檔案刪除
-R 上傳整個目錄
-n 只下載較新的檔案
-r 不用遞迴到目錄中
--parallel=n 同時下載 n 個檔案(預設一次只下載一個)

lftpget

lftpget [options] url

-c
Continue or restart a paused transaction.

Examples:

 lftp> cat file | gzip > file.gz
 lftp> get file &
 lftp> (cd /path && get file) &

備忘

用 UTF-8,存取 Big5 亂碼

進入 lftp 後

set ftp:charset Big5

[ 書籤 | 搜尋 | blog | 留言 | Home ]

Firefox Emacs Muse Debian

最後更新 二月 8, 2008 , by alan

Creative Commons License
本 著作 係採用 創用 CC 姓名標示-非商業性-相同方式分享 2.5 台灣 授權條款授權.