lftp

Lftp Cheatsheet #

The lftp command-line client is a sophisticated file transfer program that supports FTP, HTTP, and other protocols.

Basic Commands #

Command/OptionExampleDescription
lftplftpStart the lftp interactive shell
lftp -u usernamelftp -u user ftp.example.comConnect to an FTP server with a specified username
lftp -u username,passwordlftp -u user,pass ftp.example.comConnect with username and password
lftp -e 'command'lftp -e 'ls' ftp.example.comExecute a command and exit
lftp ftp.example.comlftp ftp.example.comConnect to an FTP server

File Operations #

Command/OptionExampleDescription
getget file.txtDownload a file from the remote server
putput file.txtUpload a file to the remote server
mirrormirror /local/dir /remote/dirMirror directories from local to remote
mirror -Rmirror -R /local/dir /remote/dirMirror directories from remote to local

Directory Navigation #

Command/OptionExampleDescription
lslsList files and directories
cdcd /path/to/dirChange directory
pwdpwdPrint working directory
mkdirmkdir newdirCreate a new directory
rmdirrmdir dirRemove a directory

Advanced Features #

Command/OptionExampleDescription
-dlftp -d ftp.example.comEnable debug output
-flftp -f script.txtRead commands from a file
-clftp -c 'ls' ftp.example.comExecute a command and exit
-ulftp -u user,pass ftp.example.comConnect with username and password
setset ftp:ssl-allow trueConfigure settings, e.g., SSL

This cheatsheet covers essential lftp commands and options for file transfers and directory management.

lftp

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.