Skip to content

Latest commit

 

History

History
170 lines (112 loc) · 2.19 KB

lftp.md

File metadata and controls

170 lines (112 loc) · 2.19 KB

lftp Cheatsheet

Andrew Pennebaker

https://github.com/mcandre/cheatsheets/blob/master/lftp.md

About

lftp is a command line FTP file transfer client.

Documentation

man lftp

LFTP Pocket Reference

Install

$ apt-get install lftp

$ brew install lftp

C:\> chocolatey install lftp

lftp-for-windows

Configure

$HOME/.lftprc

Reference Dotfile

Tab completion for bookmarks

See lftp-completion

Supported protocols

  • FTP
  • SFTP
  • FTPS
  • FTPES
  • FISH
  • HFTP
  • HTTP
  • HTTPS

Connect to server

$ lftp [-u <username>,<password>] <URL>

Create a bookmark

> bookmark add <name>

Connect to bookmarked server

$ lftp <name>

Quit

> quit

Or

Control+D

Change local directory

> lcd <local directory>

View local directory

> lpwd

Change remote directory

> cd

View remote directory

> ls

Update file listing

cache flush

Download single file

> get <file>

Download single file faster via parallel segments

> pget <file>

Upload file

> put <file>

Download directory

> mirror <remote directory>

Upload directory

> mirror -R <local path> <remote path>

Create directory

> mkdir

Move file or directory

> mv <current filename> <new filename>

Delete file or directory

> rm [-r] [-f] <file or directory>
> rmdir <directory>

Alternatives

  • wget specializes in webcrawling.
  • curl outputs to STDOUT by default, making it a popular choice for debugging REST services.
  • scp specializes in SSH file transfers.
  • WWW::Mechanize is a Perl library for fine-tuned Web crawling.
  • Rsync