lftp(1)

πŸ“¦
version 4.9.3 Β· 2 versions
, in alpine 3.24, arch rolling, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… lftp(1) β€” General Commands Manual πŸ’…

πŸ’– NAME πŸ’–

lftp β€” Sophisticated file transfer program πŸ’…


✨ SYNTAX ✨

lftp [-d] [-e cmd] [-p port] [-u user[,pass]] [site]
lftp -f script_file
lftp -c commands
lftp --version
lftp --help

πŸ¦‹ VERSION πŸ¦‹

This man page documents lftp version 4.8.1. periodt πŸ’–


🌈 DESCRIPTION 🌈

Ok bestie, listen. lftp is a file transfer program that lets you do sophisticated FTP, HTTP and other connections to other hosts. If site is specified then lftp will connect to that site, otherwise a connection has to be established with the open command.

lftp can handle several file access methods β€” FTP, FTPS, HTTP, HTTPS, HFTP, FISH, SFTP and file (HTTPS and FTPS are only available when lftp is compiled with GNU TLS or OpenSSL library). You can specify the method to use in open URL command, e.g. open http://www.us.kernel.org/pub/linux. HFTP is ftp-over-http-proxy protocol. It can be used automatically instead of FTP if ftp:proxy is set to http://proxy[:port]. Fish is a protocol working over an ssh connection to a unix account. SFtp is a protocol implemented in SSH2 as SFTP subsystem.

Besides FTP-like protocols, lftp has support for BitTorrent protocol as torrent command. Seeding is also supported. iconic ✨

Every operation in lftp is reliable, that is any non-fatal error is handled properly and the operation is repeated. So if downloading breaks, it will be restarted from the point automatically. Even if FTP server does not support the REST command, lftp will try to retrieve the file from the very beginning until the file is transferred completely. No cap, it's persistent. πŸ’ͺ

lftp has shell-like command syntax allowing you to launch several commands in parallel in background (&). It is also possible to group commands within () and execute them in background. All background jobs are executed in the same single process. You can bring a foreground job to background with ^Z (c-z) and back with command wait (or fg which is alias to wait). To list running jobs, use command jobs. Some commands allow redirecting their output (cat, ls, ...) to file or via pipe to external command. Commands can be executed conditionally based on termination status of previous command (&&, ||).

If you exit lftp before all jobs are not finished yet, lftp will move itself to nohup mode in background. The same thing happens with a real modem hangup or when you close an xterm.

lftp has built-in mirror which can download or update a whole directory tree. There is also reverse mirror (mirror -R) which uploads or updates a directory tree on server. Mirror can also synchronize directories between two remote servers, using FXP if available.

There is command at to launch a job at specified time in current context, command queue to queue commands for sequential execution for current server, and much more.

On startup, lftp executes /etc/lftp.conf and then ~/.lftprc and ~/.lftp/rc (or ~/.config/lftp/rc if ~/.lftp does not exist). You can place aliases and set commands there. Some people prefer to see full protocol debug, use debug to turn the debug on. Use debug 3 to see only greeting messages and error messages.

lftp has a number of settable variables. You can use set -a to see all variables and their values or set -d to see list of defaults. Variable names can be abbreviated and prefix can be omitted unless the rest becomes ambiguous.

If lftp was compiled with OpenSSL (configure --with-openssl) it includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org/)


πŸŽ€ Commands πŸŽ€

Now the commands, bestie. Each one is a little slay.

  • ! shell command β€” Launch shell or shell command.

Example: !ls β€” To do a directory listing of the local host.

  • alias [name [value]] β€” Define or undefine alias name. If value is omitted, the alias is undefined, else it takes the value value. If no argument is given the current aliases are listed.

Examples:

alias dir ls -lF
alias less zmore
  • at time [ -- command ] β€” Wait until the given time and execute given (optional) command. See also at(1).
  • attach [PID] β€” Attach the terminal to specified backgrounded lftp process.
  • bookmark [subcommand] β€” The bookmark command controls bookmarks.

Site names can be used in the open command directly as-is or in any command that accepts input URLs using the bm:site/path format.

  • add <name> [<loc>] β€” add current place or given location to bookmarks and bind to given name
  • del <name> β€” remove bookmark with name
  • edit β€” start editor on bookmarks file
  • import <type> β€” import foreign bookmarks
  • list β€” list bookmarks (default)
  • cache [subcommand] β€” The cache command controls local memory cache. The following subcommands are recognized:
    • stat β€” print cache status (default)
    • on|off β€” turn on/off caching
    • flush β€” flush cache
    • size lim β€” set memory limit, -1 means unlimited
    • expire Nx β€” set cache expiration time to N seconds (x=s) minutes (x=m) hours (x=h) or days (x=d)
  • cat files β€” cat outputs the remote file(s) to stdout. (See also more, zcat and zmore)
  • cd rdir β€” Change current remote directory. The previous remote directory is stored as -. You can do cd - to change the directory back. The previous directory for each site is also stored on disk, so you can do open site; cd - even after lftp restart.
  • chmod [OPTS] mode files... β€” Change permission mask on remote files. The mode can be an octal number or a symbolic mode (see chmod(1)).
    • -c, --changes β€” like verbose, but only spills the tea when a change is actually made
    • -f, --quiet β€” shhh, suppress most error messages
    • -v, --verbose β€” gives you a diagnostic for every single file it processes
    • -R, --recursive β€” do it recursively, files and directories, no skips
  • close [-a] β€” Close idle connections. By default only with the current server, use -a to close all idle connections.
  • cls [OPTS] files... β€” cls tries to retrieve information about specified files or directories and outputs the information according to format options. The difference between ls and cls is that ls requests the server to format file listing, and cls formats it itself, after retrieving all the needed information.
    • -1 β€” one column, no extras
    • -a, --all β€” show those hidden dot files too
    • -B, --basename β€” just the basename, not the whole path
    • --block-size=SIZ β€” measure in SIZ-byte blocks
    • -d, --directory β€” list the directory itself, not what's inside
    • -F, --classify β€” slap a little / or @ on entries
    • -h, --human-readable β€” sizes that make sense to humans, like 1K
    • --si β€” same vibe, but powers of 1000 instead of 1024
    • -k, --kilobytes β€” same as --block-size=1024
    • -l, --long β€” long listing format, the whole tea
    • -q, --quiet β€” don't show status, keep it lowkey
    • -s, --size β€” print each file's size
    • --filesize β€” if you're printing size, only do it for files
    • -i, --nocase β€” pattern matching that doesn't care about case
    • -I, --sortnocase β€” sort names without caring about case
    • -D, --dirsfirst β€” directories get to go first
    • --sort=OPT β€” sort by OPT: "name", "size", or "date"
    • -S β€” sort by file size
    • --user, --group, --perms, --date, --linkcount, --links β€” show individual fields like user, group, perms, date, linkcount, links
    • --time-style=STYLE β€” use the time format you specify
  • command cmd args... β€” execute given command ignoring aliases.
  • debug [OPTS] level|off β€” Switch debugging to level or turn it off. Options:
    • -T β€” truncate output file
    • -o <file> β€” redirect debug output to the file
    • -c β€” show message context
    • -p β€” show PID
    • -t β€” show timestamps
  • du [OPTS] path... β€” Summarize disk usage. Options:
    • -a, --all β€” write counts for all files, not just directories
    • --block-size=SIZ β€” use SIZ-byte blocks
    • -b, --bytes β€” print size in bytes
    • -c, --total β€” produce a grand total
    • -d, --max-depth=N β€” print the total for a directory (or file, with --all) only if it is N or fewer levels below the command line argument; --max-depth=0 is the same as --summarize
    • -F, --files β€” print number of files instead of sizes
    • -h, --human-readable β€” print sizes in human readable format (e.g., 1K 234M 2G)
    • -H, --si β€” likewise, but use powers of 1000 not 1024
    • -k, --kilobytes β€” like --block-size=1024
    • -m, --megabytes β€” like --block-size=1048576
    • -S, --separate-dirs β€” do not include size of subdirectories
    • -s, --summarize β€” display only a total for each argument
    • --exclude=PAT β€” exclude files that match PAT
  • echo [-n] string β€” Prints (echos) the given string to the display.
  • edit [OPTS] file β€” Retrieve remote file to a temporary location, run a local editor on it and upload the file back if changed. Options:
    • -k β€” keep the temporary file
    • -o <temp> β€” explicit temporary file location
  • eval [-f format ] args... β€” without -f it executes given arguments as a command. With -f, arguments are transformed into a new command. The format can contain plain text and placeholders $0...$9 and $@, corresponding to the arguments.
  • exit [bg] [top] [parent] [kill] [code] β€” exit will exit from lftp or move to background if there are active jobs. If no job is active, code is passed to operating system as lftp's termination status. If code is omitted, the exit code of last command is used.

exit bg forces moving to background when cmd:move-background is false. exit top makes top level shell (internal lftp command executor) terminate. exit parent terminates the parent shell when running a nested script. exit kill kills all numbered jobs before exiting. The options can be combined, e.g. at 08:00 -- exit top kill & kills all jobs and makes lftp exit at specified time.

  • fg β€” Alias for wait.
  • find [OPTS] directory...

List files in the directory (current directory by default) recursively. Lowkey a lifesaver when your server is out here with no ls -R support bestie. You can redirect the output of this command too. Options, periodt:

  • -d MD, --max-depth=MD β€” sets the maximum scan depth, so you don't go feral digging through infinite folders πŸ’…
  • -l, --ls β€” use the long listing format

ftpcopy

Obsolete. Not it, bestie. Use one of these instead:

get ftp://... -o ftp://...
get -O ftp://... file1 file2...
put ftp://...
mput ftp://.../*
mget -O ftp://... ftp://.../*

or literally any other combo that gets you an FXP transfer (that's a transfer going directly between two FTP servers, iykyk). And heads up: lftp would fallback to plain copy (via the client) if the FXP transfer cannot be initiated or if ftp:use-fxp is false. So no cap, it still gets there.


get [-E] [-a] [-c] [-e] [-P N] [-O base] rfile [-o lfile] ...

Grab that remote file rfile and drop it as the local file lfile. If you leave out -o, it's stored to a local file named as the base name of rfile. You can get multiple files by specifying multiple instances of rfile (and -o lfile). Does not expand wildcards β€” use mget for that, bestie.

  • -c β€” continue, reget ✨
  • -E β€” delete source files after a successful transfer
  • -e β€” delete target file before the transfer
  • -a β€” use ascii mode (binary is the default)
  • -P N β€” download N files in parallel, main character multitasking energy πŸ‘‘
  • -O <base> β€” specifies base directory or URL where files should be placed

Examples, because seeing it hit different:

get README
get README -o debian.README
get README README.mirrors
get README -o debian.README README.mirrors -o debian.mirrors
get README -o ftp://some.host.org/debian.README
get README -o ftp://some.host.org/debian-dir/   (end slash is important)
That trailing slash is important, don't come for me, just trust 🫢

get1 [OPTS] rfile

Transfer a single file. Options:

  • -o <lfile> β€” destination file name (default: basename of rfile)
  • -c β€” continue, reget
  • -E β€” delete source files after a successful transfer
  • -a β€” use ascii mode (binary is the default)
  • -d β€” create the directory of the target file
  • --source-region=<from-to> β€” transfer the specified region of the source file
  • --target-position=<pos> β€” position in the target file to write data at

glob [OPTS] [command] patterns

Glob those patterns containing metacharacters and pass the result to the given command, or just return the appropriate exit code. Options:

  • -f β€” plain files (default)
  • -d β€” directories
  • -a β€” all types
  • --exist β€” return zero exit code when the patterns expand to a non-empty list
  • --not-exist β€” return zero exit code when the patterns expand to an empty list

Examples:

glob echo *
glob --exist *.csv && echo "There are *.csv files"

help [cmd]

Print help for cmd, or if no cmd was specified, print a list of available commands. Your lil built-in bestie πŸŽ€


history [OPTS] [cnt]

View or manipulate the command history. The optional argument cnt specifies the number of history lines to list, or "all" to list every single entry. Options:

  • -w <file> β€” Write history to file.
  • -r <file> β€” Read history from file; appends to current history.
  • -c β€” Clear the history.
  • -l β€” List the history (default).

jobs [OPTS] [job_no...]

List running jobs. If job_no is specified, only list the job with that number. Options:

  • -v β€” verbose, several -v increase verbosity
  • -r β€” list just one specified job without recursion

kill all|job_no

Delete the specified job with job_no, or all jobs. (For job_no, see jobs.) Yes it kills them. Yes it's dramatic. πŸ’€


lcd ldir

Change the current local directory to ldir. The previous local directory is stored as -. So you can do lcd - to change the directory back. Undo button but make it shell ✨


ln [-s] existing-file new-link

Make a hard/symbolic link to an existing file. Option -s selects creation of a symbolic link.


local command

Run the specified command with a local directory file:// session instead of a remote session. Examples:

local pwd
local ls
local mirror /dir1 /dir2

lpwd

Print the current working directory on the local machine. Not the remote one, bestie, read the name 😭


ls params

List remote files. You can redirect the output of this command to a file or via a pipe to an external command. And ngl, by default ls output is cached, so to see a fresh listing use rels or cache flush. Don't be out here mad at stale results πŸ¦‹


mget [-c] [-d] [-a] [-E] [-e] [-P N] [-O base] files

Gets selected files with expanded wildcards. Options:

  • -c β€” continue, reget.
  • -d β€” create directories the same as the file names and get the files into them instead of the current directory.
  • -E β€” delete source files after a successful transfer
  • -e β€” delete target file before the transfer
  • -a β€” use ascii mode (binary is the default)
  • -P N β€” download N files in parallel
  • -O <base> β€” specifies base directory or URL where files should be placed

mirror [OPTS] [source [target]]

Mirror the specified source directory to the target directory. The iconic one, fr fr πŸͺžβœ¨

By default the source is remote and the target is a local directory. When you use -R, the source directory is local and the target is remote. If the target directory is omitted, the base name of the source directory is used. And if both directories are omitted, the current local and remote directories are used.

The source and/or the target may be URLs pointing to directories.

If the target directory ends with a slash (except the root directory) then the base name of the source directory is appended.

  • -c, --continue β€” continue a mirror job if possible ✨
  • -e, --delete β€” delete files not present at the source πŸ’…
  • --delete-excluded β€” delete files excluded at the target πŸ™ˆ
  • --delete-first β€” delete old files before transferring new ones πŸ—‘οΈ
  • --depth-first β€” descend into subdirectories before transferring files πŸ•³οΈ
  • --scan-all-first β€” scan all directories recursively before transferring files πŸ‘€
  • -s, --allow-suid β€” set suid/sgid bits according to the source πŸ”
  • --allow-chown β€” try to set owner and group on files πŸ‘‘
  • --ascii β€” use ascii mode transfers (implies --ignore-size) πŸ“ 
  • --ignore-time β€” ignore time when deciding whether to download ⏰
  • --ignore-size β€” ignore size when deciding whether to download πŸ“
  • --only-missing β€” download only missing files πŸ•΅οΈ
  • --only-existing β€” download only files already existing at target 🎟️
  • -n, --only-newer β€” download only newer files (-c won't work) ✨
  • --upload-older β€” upload even files older than the target ones πŸ§“
  • --transfer-all β€” transfer all files, even seemingly the same at the target site 🚚
  • --no-empty-dirs β€” don't create empty directories (implies --depth-first) πŸšͺ
  • -r, --no-recursion β€” don't go to subdirectories πŸ›‘
  • --recursion=MODE β€” go to subdirectories on a condition πŸŽ›οΈ
  • --no-symlinks β€” don't create symbolic links πŸ”—πŸš«
  • -p, --no-perms β€” don't set file permissions πŸ™ˆ
  • --no-umask β€” don't apply umask to file modes πŸ’…
  • -R, --reverse β€” reverse mirror (put files) πŸ”„
  • -L, --dereference β€” download symbolic links as files πŸ“„
  • --overwrite β€” overwrite plain files without removing them first ✍️
  • --no-overwrite β€” remove and re-create plain files instead of overwriting πŸ—‘οΈβž‘οΈβœ¨
  • -N, --newer-than=SPEC β€” download only files newer than specified time, or specified local file modification time. ⏳
  • --older-than=SPEC β€” download only files older than specified time, or specified local file modification time. πŸ•°οΈ
  • --size-range=RANGE β€” download only files with size in specified range πŸ“
  • -P, --parallel[=N] β€” download N files in parallel πŸ‘―
  • --use-pget[-n=N] β€” use pget to transfer every single file πŸ’…
  • --on-change=CMD β€” execute the command if anything has been changed πŸ””
  • --loop β€” repeat mirror until no changes found πŸ”
  • -i RX, --include=RX β€” include matching files πŸ’–
  • -x RX, --exclude=RX β€” exclude matching files 🚫
  • -I GP, --include-glob=GP β€” include matching files ✨
  • -X GP, --exclude-glob=GP β€” exclude matching files πŸ™…
  • --include-rx-from=FILE β€” load include/exclude patterns from the file, one per line πŸ“„
  • --exclude-rx-from=FILE β€” load include/exclude patterns from the file, one per line πŸ“„
  • --include-glob-from=FILE β€” load include/exclude patterns from the file, one per line πŸ“„
  • --exclude-glob-from=FILE β€” load include/exclude patterns from the file, one per line πŸ“„
  • -f FILE, --file=FILE β€” mirror a single file or globbed group (e.g. /path/to/*.txt) πŸ“
  • -F DIR, --directory=DIR β€” mirror a single directory or globbed group (e.g. /path/to/dir*) πŸ“‚
  • -O DIR, --target-directory=DIR β€” target base path or URL 🎯
  • -v, --verbose[=level] β€” verbose operation πŸ—£οΈ
  • --log=FILE β€” write lftp commands being executed to FILE πŸ“
  • --script=FILE β€” write lftp commands to FILE, but don't execute them πŸ“
  • --just-print, --dry-run β€” same as --script=- πŸ§ͺ
  • --max-errors=N β€” stop after this number of errors πŸ›‘
  • --skip-noaccess β€” don't try to transfer files with no read access. 🚫
  • --use-cache β€” use cached directory listings πŸ—„οΈ
  • --Remove-source-files β€” remove source files after transfer (use with caution) ⚠️
  • --Remove-source-dirs β€” remove source files and directories after transfer (use with caution). Top level directory is not removed if its name ends with a slash. ⚠️
  • --Move β€” same as --Remove-source-dirs 🚚
  • -a β€” same as --allow-chown --allow-suid --no-umask 🍟

RX is an extended regular expression, just like in egrep(1). πŸ’…

GP is a glob pattern, e.g. *.zip. ✨

Include and exclude options can be specified multiple times. It means that a file or directory would be mirrored if it matches an include and does not match to excludes after the include, or does not match anything and the first check is exclude. Directories are matched with a slash appended. πŸŽ€

Note that symbolic links are not created when uploading to remote server, because FTP protocol cannot do it. To upload files the links refer to, use mirror -RL command (treat symbolic links as files). 🫢

For options --newer-than and --older-than you can either specify a local file or time specification like that used by at(1) command, e.g. now-7days or week ago. If you specify a file, then modification time of that file will be used. ⏰

Verbosity level can be selected using --verbose=level option or by several -v options, e.g. -vvv. Levels are:

  • 0 β€” no output (default)
  • 1 β€” print actions
  • 2 β€” +print not deleted file names (when -e is not specified)
  • 3 β€” +print directory names which are mirrored

--only-newer turns off file size comparison and uploads/downloads only newer files even if size is different. By default older files are transferred and replace newer ones. πŸ”₯

--upload-older allows replacing newer remote files with older ones (when the target side is remote). Some remote back-ends cannot preserve timestamps so the default is to keep newer files. πŸ§“

Recursion mode can be one of always, never, missing, newer. With the option newer mirror compares timestamps of directories and enters a directory only if it is older or missing on the target side. Be aware that when a file changes the directory timestamp may stay the same, so mirror won't process that directory. πŸŒ€

The options --file and --directory may be used multiple times and even mixed provided that base directories of the paths are the same. πŸ“š

You can mirror between two servers if you specify URLs instead of directories. FXP is automatically used for transfers between FTP servers, if possible. 🌐

Some FTP servers hide dot-files by default (e.g. .htaccess), and show them only when LIST command is used with -a option. In such case try to use set ftp:list-options -a. πŸ‘»

The recursion modes newer and missing conflict with --scan-all-first, --depth-first, --no-empty-dirs and setting mirror:no-empty-dirs=true. ⚠️


mkdir [-p] [-f] dir(s)

Make remote directories. If -p is used, make all components of paths. The -f option makes mkdir quiet and suppresses messages. πŸ“

module module [ args ]

Load given module using dlopen(3) function. If module name does not contain a slash, it is searched in directories specified by module:path variable. Arguments are passed to module_init function. See README.modules for technical details. 🧩

more files

Same as cat files | more. If PAGER is set, it is used as filter. (See also cat, zcat and zmore) πŸ“„

mput [-c] [-d] [-a] [-E] [-e] [-P N] [-O base] files

Upload files with wildcard expansion. By default it uses the base name of local name as remote one. This can be changed by -d option. πŸ“€

  • -c β€” continue, reput
  • -d β€” create directories the same as in file names and put the files into them instead of current directory
  • -E β€” delete source files after successful transfer (dangerous)
  • -e β€” delete target file before the transfer
  • -a β€” use ascii mode (binary is the default)
  • -P N β€” upload N files in parallel
  • -O <base> β€” specifies base directory or URL where files should be placed

mrm file(s)

Same as glob rm. Removes specified file(s) with wildcard expansion. πŸ—‘οΈ

mmv [-O directory] file(s) directory

Move specified files to a target directory. The target directory can be specified after -O option or as the last argument. 🚚

  • -O <dir> β€” tells it where the files should land, i.e. the target directory 🎯

mv file1 file2

Renames file1 to file2. Nope, no wildcard expansion here bestie, not even a little πŸ™…β€β™€οΈ. But if you hand it more than two arguments, or that last argument ends with a slash, then it goes and runs the mmv command instead. Surprise!

nlist [args]

Lists the remote file names. Just the names. That's it πŸ’…

open [OPTS] site

Picks a server by host name, URL, or bookmark. And here's the cute part β€” if you give it a URL or a bookmark, it automatically moves your current working directory to the directory of that URL. Obsessed ✨

Options:

  • -e cmd β€” run this command right after the server is selected
  • -u user[,pass] β€” use this user/password to authenticate. A colon works as a separator too, not just a comma
  • -p port β€” use this port for the connection
  • -s slot β€” assign the connection to this slot
  • -d β€” turn on debug
  • -B β€” don't go looking up bookmarks
  • --user user β€” use this user for authentication
  • --password pass β€” use this password for authentication
  • --env-password β€” grab the password from the LFTP_PASSWORD environment variable
  • site β€” the host name, URL, or bookmark name
Heads up 🫢 if your user name has special characters in it (comma or colon), do not use the -u option. Use --user instead, or quote it inside the URL using percent notation like %AB.

pget [OPTS] rfile [-o lfile]

Grabs that file using several connections. It can speed up the transfer, but ngl it loads the net and the server heavily and that impacts other users 😭. So only do it if you genuinely have to get this file ASAP.

Options:

  • -c β€” continue the transfer. Needs a lfile.lftp-pget-status file.
  • -n maxconn β€” set the maximum number of connections (default comes from the pget:default-n setting)

put [-E] [-a] [-c] [-e] [-P N] [-O base] lfile [-o rfile]

Uploads lfile with remote name rfile. If you skip -o, the base name of lfile becomes the remote name. No wildcard expansion here β€” if that's what you want, use mput instead.

  • -o <rfile> β€” specifies the remote file name (default is the basename of lfile)
  • -c β€” continue, i.e. reput. Requires permission to overwrite remote files
  • -E β€” delete the source files after a successful transfer (dangerous ⚠️)
  • -e β€” delete the target file before the transfer
  • -a β€” use ascii mode (binary is the default)
  • -P N β€” upload N files in parallel
  • -O <base> β€” specifies the base directory or URL where files should be placed

pwd [-p]

Prints the current remote URL. Pop the -p option in there if you want the password shown in the URL πŸ‘€

queue [-n num ] cmd

Adds the given command to the queue for sequential execution. Every site has its own queue, btw. -n adds the command before the given item in the queue. Do not try to queue cd or lcd commands β€” it may confuse lftp πŸ˜΅β€πŸ’«. Instead, do the cd/lcd before the queue command and it'll remember the place where the command is supposed to run. Oh and you can queue up an already running job with queue wait <jobno>, but know that the job will keep executing even if it's not first in the queue.

queue stop stops the queue β€” it won't execute any new commands, but jobs already running keep running. You can use queue stop to create an empty stopped queue. queue start resumes queue execution. And when you exit lftp, it starts all stopped queues automatically ✨

queue with no arguments will either create a stopped queue or print the queue status.

queue --delete|-d [index or wildcard expression]

Deletes one or more items from the queue. If you give it no argument, the last entry in the queue gets deleted.

queue --move|-m <index or wildcard expression> [index]

Moves the given items before the given queue index, or to the end if you don't give a destination.

  • -q β€” be quiet
  • -v β€” be verbose
  • -Q β€” output in a format that can be used to re-queue. Super useful with --delete.

Examples:

> get file &
[1] get file
> queue wait 1
> queue get another_file
> cd a_directory
> queue get yet_another_file

queue -d 3             Delete the third item in the queue.
queue -m 6 4           Move the sixth item in the queue before
                       the fourth.
queue -m "get*zip" 1   Move all commands matching "get*zip" to
                       the beginning of the queue.  (The order of
                       the items is preserved.)
queue -d "get*zip"     Delete all commands matching "get*zip".

quote cmd

For FTP β€” sends the command uninterpreted. Use with caution 🫣 it can lead to unknown remote state and therefore cause a reconnect. You cannot be sure that any change of remote state caused by a quoted command is solid β€” it can get reset by a reconnect at any time.

For HTTP β€” specific to the HTTP action. Syntax: quote <command> [<args>]. The command may be set-cookie or post.

open http://www.site.net
quote set-cookie "variable=value; othervar=othervalue"
set http:post-content-type application/x-www-form-urlencoded
quote post /cgi-bin/script.cgi "var=value&othervar=othervalue" > local_file

For FISH β€” sends the command uninterpreted. This one lets you execute arbitrary commands on the server. The command must not take input or print ### at the beginning of a new line. If it does, the protocol will fall out of sync πŸ’€

open fish://server
quote find -name \*.zip

reget rfile [-o lfile]

Same as get -c.

rels [args]

Same as ls, but it ignores the cache 🧹

renlist [args]

Same as nlist, but it ignores the cache 🧹

repeat [OPTS] [[-d] delay] [command]

Repeats the specified command with a delay between iterations. Default delay is one second, default command is empty.

  • -c <count> β€” maximum number of iterations
  • -d <delay> β€” delay between iterations
  • --while-ok β€” stop when the command exits with a non-zero code
  • --until-ok β€” stop when the command exits with a zero code
  • --weak β€” stop when lftp moves to background

Examples:

repeat at tomorrow -- mirror
repeat 1d mirror

reput lfile [-o rfile]

Same as put -c.

rm [-r] [-f] files

Removes remote files. Does not expand wildcards β€” use mrm for that. -r is for recursive directory remove. Be careful, if something goes wrong you can lose files 😭. -f suppresses error messages.

rmdir dir(s)

Removes remote directories.

scache [session]

Lists cached sessions, or switches to the specified session.

set [var [val]]

Sets the variable to the given value. If you omit the value, it unsets the variable. Variable names have the format name/closure, where the closure can specify the exact application of the setting. See below for details πŸ‘‡ If set is called with no variable, then only altered settings get listed. That behaviour can be changed with options:

  • -a β€” list all settings, including default values
  • -d β€” list only default values, not necessarily the current ones

site site_cmd

Executes the site command site_cmd and outputs the result. You can redirect its output.

sleep interval

Sleeps for the given time interval and exits. The interval is in seconds by default, but you can suffix it with m, h, d for minutes, hours, and days respectively. See also at.

slot [name]

Selects the specified slot, or lists all allocated slots. A slot is a connection to a server, kind of like a virtual console πŸ–₯️. You can create multiple slots connected to different servers and switch between them. You can also use slot:name as a pseudo-URL that evaluates to that slot's location.

The default readline binding lets you quickly switch between slots named 0-9 using the Meta-0 - Meta-9 keys (often you can use Alt instead of Meta).

source file source -e command

Executes the commands recorded in the file file, or the ones returned by the specified external command.

source ~/.lftp/rc
source -e echo help

suspend

Stops the lftp process. Note that transfers get stopped too, until you continue the process with your shell's fg or bg commands 😴

torrent [OPTS] torrent-files...

Starts the BitTorrent process for the given torrent-files, which can be a local file, URL, magnet link, or a plain info_hash written in hex or base32. Local wildcards get expanded. Existing files are first validated unless the --force-valid option is given. Missing pieces get downloaded. Files are stored in the specified directory, or the current working directory by default. Seeding continues until the ratio reaches the torrent:stop-on-ratio setting, or the time of torrent:seed-max-time runs out.

Options:

  • -O <directory> β€” specifies the base directory where files should be placed
  • --force-valid β€” skip file validation (only if you're sure they're ok πŸ‘€)
  • --only-new β€” stop if the metadata is already known, or if the torrent is complete
  • --only-incomplete β€” stop if the torrent is already complete
  • --dht-bootstrap=<node> β€” bootstrap DHT by sending a query to the specified node. This option should be used just once to fill the local node cache. A port number may be given after a colon; the default is 6881. Here are some nodes for bootstrapping: dht.transmissionbt.com, router.utorrent.com, router.bittorrent.com.
  • --share β€” share the specified file or directory using the BitTorrent protocol. The magnet link gets printed when it's ready ✨

user user [pass] user URL [pass]

Uses the specified info for remote login. If you specify a URL with a user name, the entered password gets cached so future URL references can use it πŸ”

version

Prints the lftp version.

wait [jobno] wait all

Waits for the specified job to terminate. If jobno is omitted, it waits for the last backgrounded job.

wait all waits for all jobs to terminate.

zcat files

Same as cat, but filters each file through zcat. (See also cat, more, and zmore)

zmore files

Same as more, but filters each file through zcat. (See also cat, zcat, and more)

✨ Settings ✨

On startup, lftp executes ~/.lftprc and ~/.lftp/rc (or ~/.config/lftp/rc if ~/.lftp does not exist). You can place aliases and set commands there. Some people prefer to see full protocol debug β€” use debug to turn the debug on. No cap, that's the vibe. πŸ’–

There is also a system-wide startup file in /etc/lftp.conf. It can be in different directory, see FILES section. iykyk ✨

lftp has the following settable variables (you can also use set -a to see all variables and their values):

  • bmk:save-passwords (boolean) β€” save plain text passwords in ~/.local/share/lftp/bookmarks or ~/.lftp/bookmarks on bookmark add command. Off by default. Not me storing plaintext passwords unless you ask. πŸ™ˆ
  • cache:cache-empty-listings (boolean) β€” When false, empty listings are not cached.
  • cache:enable (boolean) β€” When false, cache is disabled. Simple as that.
  • cache:expire (time interval) β€” Positive cache entries expire in this time interval.
  • cache:expire-negative (time interval) β€” Negative cache entries expire in this time interval.
  • cache:size (number) β€” Maximum cache size. When exceeded, oldest cache entries will be removed from cache.
  • cmd:at-exit (string) β€” the commands in string are executed before lftp exits or moves to background. Main character exit. πŸ‘‘
  • cmd:at-exit-bg (string) β€” the commands in string are executed before backgrounded lftp exits.
  • cmd:at-exit-fg (string) β€” the commands in string are executed before foreground lftp exits.
  • cmd:at-background (string) β€” the commands in string are executed before lftp moves to background.
  • cmd:at-terminate (string) β€” the commands in string are executed before lftp terminates (either backgrounded or foreground).
  • cmd:at-finish (string) β€” the commands in string are executed once when all jobs are done.
  • cmd:at-queue-finish (string) β€” the commands in string are executed once when all jobs in a queue are done.
  • cmd:cls-completion-default (string) β€” default cls options for displaying completion choices. For example, to make completion listings show file sizes, set cmd:cls-completion-default to -s.
  • cmd:cls-default (string) β€” default cls command options. They can be overridden by explicitly given options.
  • cmd:cls-exact-time (boolean) β€” when true, cls would try to get exact file modification time even if it means more requests to the server.
  • cmd:csh-history (boolean) β€” enables csh-like history expansion.
  • cmd:default-protocol (string) β€” The value is used when open is used with just host name without protocol. Default is ftp.
  • cmd:fail-exit (boolean) β€” if true, exit when a command fails and the following command is unconditional (i.e. does not begin with || or &&). lftp exits after the unconditional command is issued without executing it.
  • cmd:interactive (tri-boolean) β€” when true, lftp acts interactively, handles terminal signals and outputs some extra messages. Default is auto and depends on stdin being a terminal.
  • cmd:long-running (seconds) β€” time of command execution, which is considered as long and a beep is done before next prompt. 0 means off.
  • cmd:ls-default (string) β€” default ls argument
  • cmd:move-background (boolean) β€” when false, lftp refuses to go to background when exiting. To force it, use exit bg.
  • cmd:move-background-detach (boolean) β€” when true (default), lftp detaches itself from the control terminal when moving to background, it is possible to attach back using attach command; when false, lftp tricks the shell to move lftp to background process group and continues to run, then fg shell command brings lftp back to foreground unless it has done all jobs and terminated.
  • cmd:prompt (string) β€” The prompt. lftp recognizes the following backslash-escaped special characters that are decoded as follows:
    • \@ β€” insert @ if the current remote site user is not default
    • \a β€” an ASCII bell character (07)
    • \e β€” an ASCII escape character (033)
    • \h β€” the remote hostname you are connected to
    • \n β€” newline
    • \s β€” the name of the client (lftp)
    • \S β€” current slot name
    • \u β€” the username of the remote site user you are logged in as
    • \U β€” the URL of the remote site (e.g., ftp://g437.ub.gu.se/home/james/src/lftp)
    • \v β€” the version of lftp (e.g., 2.0.3)
    • \w β€” the current working directory at the remote site
    • \W β€” the base name of the current working directory at the remote site
    • \l β€” the current working directory at the local site
    • \L β€” the base name of the current working directory at the local site
    • \nnn β€” the character corresponding to the octal number nnn
    • \\ β€” a backslash
    • \? β€” skips next character if previous substitution was empty.
    • \[ β€” begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the prompt
    • \] β€” end a sequence of non-printing characters
  • cmd:parallel (number) β€” Number of jobs run in parallel in non-interactive mode. For example, this may be useful for scripts with multiple get commands. Note that setting this to a value greater than 1 changes conditional execution behaviour, basically makes it inconsistent. Not the vibe.
  • cmd:queue-parallel (number) β€” Number of jobs run in parallel in a queue.
  • cmd:remote-completion (boolean) β€” a boolean to control whether or not lftp uses remote completion. When true, Tab key guesses if the word being completed should be a remote file name. Meta-Tab does remote completion always. So you can force remote completion with Meta-Tab when cmd:remote-completion is false or when the guess is wrong.
  • cmd:save-cwd-history (boolean) β€” when true, lftp saves last CWD of each site to ~/.local/share/lftp/cwd_history or ~/.lftp/cwd_history, allowing to do cd - after lftp restart. Default is true.
  • cmd:save-rl-history (boolean) β€” when true, lftp saves readline history to ~/.local/share/lftp/rl_history or ~/.lftp/rl_history on exit. Default is true.
  • cmd:show-status (boolean) β€” when false, lftp does not show status line on terminal. Default is true.
  • cmd:set-term-status (boolean) β€” when true, lftp updates terminal status if supported (e.g. xterm). The closure for this setting is the terminal type from TERM environment variable.
  • cmd:status-interval (timeinterval) β€” the time interval between status updates.
  • cmd:stifle-rl-history (number) β€” the number of lines to keep in readline history.
  • cmd:term-status (string) β€” the format string to use to display terminal status. The closure for this setting is the terminal type from TERM environment variable. Default uses tsl and fsl termcap values.

The following escapes are supported:

  • \a β€” bell
  • \e β€” escape
  • \n β€” new line
  • \s β€” "lftp"
  • \v β€” lftp version
  • \T β€” the status string
  • cmd:time-style (string) β€” This setting is the default value for cls --time-style option.
  • cmd:trace (boolean) β€” when true, lftp prints the commands it executes (like sh -x).
  • cmd:verify-host (boolean) β€” if true, lftp resolves host name immediately in open command. It is also possible to skip the check for a single open command if & is given, or if ^Z is pressed during the check.
  • cmd:verify-path (boolean) β€” if true, lftp checks the path given in cd command. It is also possible to skip the check for a single cd command if & is given, or if ^Z is pressed during the check. Examples:
set cmd:verify-path/hftp://* false
cd directory &
  • cmd:verify-path-cached (boolean) β€” When false, cd to a directory known from cache as existent will succeed immediately. Otherwise the verification will depend on cmd:verify-path setting.
  • color:use-color (tri-boolean) β€” when true, cls command and completion output colored file listings according to color:dir-colors setting. When set to auto, colors are used when output is a terminal.
  • color:dir-colors (string) β€” file listing color description. By default the value of LS_COLORS environment variable is used. See dircolors(1).
  • dns:SRV-query (boolean) β€” query for SRV records and use them before gethostbyname. The SRV records are only used if port is not explicitly specified. See RFC2052 for details.
  • dns:cache-enable (boolean) β€” enable DNS cache. If it is off, lftp resolves host name each time it reconnects.
  • dns:cache-expire (time interval) β€” time to live for DNS cache entries. It has format <number><unit>+, e.g. 1d12h30m5s or just 36h. To disable expiration, set it to inf or never.
  • dns:cache-size (number) β€” maximum number of DNS cache entries.
  • dns:fatal-timeout (time interval) β€” limit the time for DNS queries. If DNS server is unavailable too long, lftp will fail to resolve a given host name. Set to never to disable.
  • dns:order (list of protocol names) β€” sets the order of DNS queries. Default is inet6 inet which means first look up address in inet6 family, then inet and use them in that order. To disable inet6 (AAAA) lookup, set this variable to inet.
  • dns:use-fork (boolean) β€” if true, lftp will fork before resolving host address. Default is true.
  • dns:max-retries (number) β€” If zero, there is no limit on the number of times lftp will try to lookup an address. If > 0, lftp will try only this number of times to look up an address of each address family in dns:order.
  • dns:name (string) β€” This setting can be used to substitute a host name alias with another name or IP address. The host name alias is used as the setting closure, the substituted name or IP address is in the value. Multiple names or IP addresses can be separated by comma.
  • file:charset (string) β€” local character set. It is set from current locale initially.
  • file:use-lock (boolean) β€” when true, lftp uses advisory locking on local files when opening them.
  • file:use-fallocate (boolean) β€” when this is true, lftp hits up fallocate(2) or posix_fallocate(3) to pre-allocate storage space and cut down on file fragmentation in pget and torrent commands. ✨
  • fish:auto-confirm (boolean) β€” when true, lftp answers yes to every single ssh question, especially the one about a new host key 🫢. Otherwise it answers no.
  • fish:charset (string) β€” the character set the fish server uses in requests, replies and file listings 🌸. Default is empty, which means same as local.
  • fish:connect-program (string) β€” the program used to connect to the remote server. It should support the -l option for user name and -p for port number. Default is ssh -a -x πŸ’…. You can set it to rsh, for example. For private key authentication, add the -i option with the key file.
  • fish:shell (string) β€” use this specified shell on the server side. Default is /bin/sh. On some systems, /bin/sh exits when you do a cd to a non-existent directory 😭. lftp can handle that, but it has to reconnect. Set it to /bin/bash for those systems if bash is installed.
  • ftp:acct (string) β€” Send this string in the ACCT command after login. The result is ignored. The closure for this setting has format user@host.
  • ftp:anon-pass (string) β€” sets the password used for anonymous FTP access authentication πŸ”‘. Default is "lftp@".
  • ftp:anon-user (string) β€” sets the user name used for anonymous FTP access authentication. Default is "anonymous".
  • ftp:auto-sync-mode (regex) β€” if the first server message matches this regex, turn on sync mode for that host.
  • ftp:catch-size (boolean) β€” when there's no support for the SIZE command, try to catch the file size from the "150 Opening data connection" reply. sneaky but it works πŸ’…
  • ftp:charset (string) β€” the character set used by the FTP server in requests, replies and file listings. Default is empty, which means same as local. This setting is only used when the server does not support UTF8.
  • ftp:client (string) β€” the name of the FTP client to send with the CLNT command, if the server supports it. If it's empty, then no CLNT command will be sent at all.
  • ftp:compressed-re (regex) β€” files with a matching name will be considered compressed, and "MODE Z" will not be used for them.
  • ftp:bind-data-socket (boolean) β€” bind the data socket to the interface of the control connection (in passive mode). Default is true, with the exception of the loopback interface.
  • ftp:fix-pasv-address (boolean) β€” if true, lftp will try to correct the address returned by the server for the PASV command when the server address is in a public network and PASV returns an address from a private network πŸ•΅οΈ. In that case lftp substitutes the server address instead of the one returned by the PASV command, and the port number is not changed. Default is true.
  • ftp:fxp-passive-source (boolean) β€” if true, lftp will try to set up the source FTP server in passive mode first, otherwise the destination one. If the first attempt fails, lftp tries to set them up the other way. If the other disposition fails too, lftp falls back to plain copy. See also ftp:use-fxp.
  • ftp:home (string) β€” Initial directory. Default is the empty string, which means auto. Set this to / if you don't like the look of %2F in FTP URLs πŸ™ˆ. The closure for this setting has format user@host.
  • ftp:ignore-pasv-address (boolean) β€” If true, lftp uses the control connection address instead of the one returned in the PASV reply for the data connection. This can be useful for broken NATs πŸ’€. Default is false.
  • ftp:list-empty-ok (boolean) β€” if set to false, empty lists from the LIST command will be treated as incorrect, and another method (NLST) will be used instead.
  • ftp:list-options (string) β€” sets options which are always appended to the LIST command. It can be useful to set this to -a if the server does not show dot (hidden) files by default πŸ‘€. Default is empty.
  • ftp:mode-z-level (number) β€” compression level (0-9) for uploading with MODE Z.
  • ftp:nop-interval (seconds) β€” delay between NOOP commands when downloading the tail of a file. This is useful for FTP servers which send a "Transfer complete" message before flushing the data transfer. In such cases NOOP commands can prevent a connection timeout ⏰.
  • ftp:passive-mode (boolean) β€” sets passive FTP mode. This can be useful if you're behind a firewall or a dumb masquerading router 😭. In passive mode lftp uses the PASV command, not the PORT command which is used in active mode. In passive mode lftp itself makes the data connection to the server; in active mode the server connects to lftp for the data transfer. Passive mode is the default.
  • ftp:port-ipv4 (ipv4 address) β€” specifies an IPv4 address to send with the PORT command. Default is empty, which means to send the address of the local end of the control connection.
  • ftp:port-range (from-to) β€” allowed port range for the local side of the data connection. Format is min-max, or full or any to indicate any port. Default is full.
  • ftp:prefer-epsv (boolean) β€” use EPSV as the preferred passive mode. Default is false.
  • ftp:proxy (URL) β€” specifies the FTP proxy to use. To disable the proxy, set this to the empty string. Note that it's an FTP proxy which uses the FTP protocol, not FTP over HTTP. The default value is taken from the environment variable ftp_proxy if it starts with ftp://. If your FTP proxy requires authentication, specify user name and password in the URL. If ftp:proxy starts with http://, then the hftp protocol (FTP over HTTP proxy) is used instead of FTP automatically ✨.
  • ftp:proxy-auth-type (string) β€” okay bestie, this one has five whole modes, buckle up πŸŽ€:
    • When set to joined, lftp sends user@proxy_user@ftp.example.org as user name to the proxy, and password@proxy_password as password.
    • When set to joined-acct, lftp sends user@ftp.example.org proxy_user (with a space) as user name to the proxy. The site password is sent as usual, and the proxy password is expected in the following ACCT command.
    • When set to open, lftp first sends the proxy user and proxy password, and then OPEN ftp.example.org followed by USER user. The site password is then sent as usual.
    • When set to user (the default), lftp first sends the proxy user and proxy password, and then user@ftp.example.org as user name. The site password is then sent as usual.
    • When set to proxy-user@host, lftp first sends USER proxy_user@ftp.example.org, then the proxy password. The site user and password are then sent as usual.
  • ftp:rest-list (boolean) β€” allow usage of the REST command before the LIST command. This might be useful for large directories, but some FTP servers silently ignore REST before LIST.
  • ftp:rest-stor (boolean) β€” if false, lftp will not try to use REST before STOR. This can be useful for some buggy servers which corrupt (fill with zeros) the file if REST followed by STOR is used πŸ’€.
  • ftp:retry-530 (regex) β€” Retry on server reply 530 for the PASS command if the text matches this regular expression. This setting should be useful to distinguish between an overloaded server (temporary condition) and an incorrect password (permanent condition) πŸ”.
  • ftp:retry-530-anonymous (regex) β€” Additional regular expression for anonymous login, just like ftp:retry-530.
  • ftp:site-group (string) β€” Send this string in the SITE GROUP command after login. The result is ignored. The closure for this setting has format user@host.
  • ftp:skey-allow (boolean) β€” allow sending an skey/opie reply if the server appears to support it. On by default.
  • ftp:skey-force (boolean) β€” do not send the plain text password over the network, use skey/opie instead. If skey/opie is not available, assume the login failed. Off by default.
  • ftp:ssl-allow (boolean) β€” if true, try to negotiate an SSL connection with the FTP server for non-anonymous access. Default is true. This and other SSL settings are only available if lftp was compiled with an ssl/tls library 🧚.
  • ftp:ssl-auth (string) β€” the argument for the AUTH command, can be one of SSL, TLS, TLS-P, TLS-C. See RFC4217 for explanations. By default TLS or SSL will be used, depending on the FEAT reply.
  • ftp:ssl-data-use-keys (boolean) β€” if true, lftp loads ssl:key-file for the protected data connection too. When false, it does not, and the server can match data and control connections by session ID. Default is true.
  • ftp:ssl-force (boolean) β€” if true, refuse to send the password in clear when the server does not support SSL 🚫. Default is false.
  • ftp:ssl-protect-data (boolean) β€” if true, request an SSL connection for data transfers. This provides privacy and transmission error correction. Was cpu-intensive on old CPUs. Default is true.
  • ftp:ssl-protect-fxp (boolean) β€” if true, request an SSL connection for data transfer between two FTP servers in FXP mode. CPSV or SSCN command will be used in that case. If the SSL connection fails for some reason, lftp would try an unprotected FXP transfer unless ftp:ssl-force is set for any of the two servers. Default is true.
  • ftp:ssl-protect-list (boolean) β€” if true, request an SSL connection for file list transfers. Default is true.
  • ftp:ssl-use-ccc (boolean) β€” if true, lftp would issue the CCC command after logon, thus disabling the ssl protection layer on the control connection.
  • ftp:stat-interval (time interval) β€” interval between STAT commands. Default is 1 second.
  • ftp:strict-multiline (boolean) β€” when true, lftp strictly checks for the multiline reply format (expects it to end with the same code as it started with). When false, this check is relaxed 😌.
  • ftp:sync-mode (boolean) β€” if true, lftp will send one command at a time and wait for the response. This might be useful if you're using a buggy FTP server or router πŸ™ˆ. When it's off, lftp sends a pack of commands and waits for the responses β€” it speeds up operation when round trip time is significant ✨. Unfortunately it does not work with all FTP servers, and some routers have troubles with it, so it's on by default.
  • ftp:timezone (string) β€” okay bestie, this is the timezone vibe for the times in listings that come back from the LIST command. It can be a GMT offset like [+|-]HH[:MM[:SS]] or literally any valid TZ value (e.g. Europe/Moscow or MSK-3MSD,M3.5.0,M10.5.0/3). The default is GMT. Set it to an empty value and it assumes the local timezone specified by the environment variable TZ. πŸ’…
  • ftp:too-many-re (regexp) β€” when a 421 reply line matches this regular expression, lftp decreases the dynamic connection limit. it's giving adaptive, fr fr. πŸ”₯
  • ftp:trust-feat (string) β€” when true, assume that FEAT returned data are correct and don't use common protocol extensions like SIZE, MDTM, REST if they are not listed. Default is false. no cap. 🫢
  • ftp:use-abor (boolean) β€” if false, lftp does not send ABOR command but closes data connection immediately. πŸ’€
  • ftp:use-allo (boolean) β€” when true, lftp sends ALLO command before uploading a file. πŸ‘‘
  • ftp:use-feat (boolean) β€” when true (default), lftp uses FEAT command to determine extended features of ftp server. the way that's default, iconic. ✨
  • ftp:use-fxp (boolean) β€” if true, lftp will try to set up direct connection between two ftp servers. main character energy. 🌈
  • ftp:use-hftp (boolean) β€” when ftp:proxy points to an http proxy, this setting selects hftp method (GET, HEAD) when true, and CONNECT method when false. Default is true. lowkey useful. πŸ¦‹
  • ftp:use-ip-tos (boolean) β€” when true, lftp uses IPTOS_LOWDELAY for control connection and IPTOS_THROUGHPUT for data connections. periodt. πŸ’œ
  • ftp:lang (boolean) β€” the language selected with LANG command, if supported as indicated by FEAT response. Default is empty which means server default. πŸŽ€
  • ftp:use-mdtm (boolean) β€” when true (default), lftp uses MDTM command to determine file modification time. πŸ’–
  • ftp:use-mdtm-overloaded (boolean) β€” when true, lftp uses two argument MDTM command to set file modification time on uploaded files. Default is false. πŸ™ˆ
  • ftp:use-mlsd (boolean) β€” when true, lftp will use MLSD command for directory listing if supported by the server. slay. ⭐
  • ftp:use-mode-z (boolean) β€” when true, lftp will use MODE Z if supported by the server to perform compressed transfers. compressed? obsessed. πŸ“
  • ftp:use-pret (tri-boolean) β€” when set to auto, usage of PRET command depends on FEAT server reply. Otherwise this setting tells whether to use it or not. PRET command informs the server about the file to be transferred before PORT or PASV commands, so that the server can adjust the data connection parameters. iykyk. 🧚
  • ftp:use-site-idle (boolean) β€” when true, lftp sends SITE IDLE command with net:idle argument. Default is false. πŸ’…
  • ftp:use-site-utime (boolean) β€” when true, lftp sends 5-argument SITE UTIME command to set file modification time on uploaded files. Default is true. πŸ”₯
  • ftp:use-site-utime2 (boolean) β€” when true, lftp sends 2-argument SITE UTIME command to set file modification time on uploaded files. Default is true. If 5-argument SITE UTIME is also enabled, 2-argument command is tried first. πŸ’–
  • ftp:use-size (boolean) β€” when true (default), lftp uses SIZE command to determine file size. ✨
  • ftp:use-stat (boolean) β€” if true, lftp sends STAT command in FXP mode transfer to know how much data has been transferred. See also ftp:stat-interval. Default is true. 🫢
  • ftp:use-stat-for-list (boolean) β€” when true, lftp uses STAT instead of LIST command. By default . is used as STAT argument. Using STAT, lftp avoids creating data connection for directory listing. Some servers require special options for STAT, use ftp:list-options to specify them (e.g. -la). 🌸
  • ftp:use-telnet-iac (boolean) β€” when true (default), lftp uses TELNET IAC command and follows TELNET protocol as specified in RFC959. When false, it does not follow TELNET protocol and thus does not double 255 (0xFF, 0377) character and does not prefix ABOR and STAT commands with TELNET IP+SYNCH signal. πŸ’€
  • ftp:use-tvfs (tri-boolean) β€” when set to auto, usage of TVFS feature depends on FEAT server reply. Otherwise this setting tells whether to use it or not. In short, if a server supports TVFS feature then it uses unix-like paths. periodt. 🌈
  • ftp:use-utf8 (boolean) β€” if true, lftp sends OPTS UTF8 ON to the server to activate UTF-8 encoding (if supported). Disable it if the file names have a different encoding and the server has a trouble with it. πŸ¦‹
  • ftp:use-quit (boolean) β€” if true, lftp sends QUIT before disconnecting from ftp server. Default is true. πŸ’œ
  • ftp:verify-address (boolean) β€” verify that data connection comes from the network address of control connection peer. This can possibly prevent data connection spoofing which can lead to data corruption. Unfortunately, this can fail for certain ftp servers with several network interfaces, when they do not set outgoing address on data socket, so it is disabled by default. 😭
  • ftp:verify-port (boolean) β€” verify that data connection has port 20 (ftp-data) on its remote end. This can possibly prevent data connection spoofing by users of remote host. Unfortunately, too many windows and even unix ftp servers forget to set proper port on data connection, thus this check is off by default. πŸ™ˆ
  • ftp:web-mode (boolean) β€” disconnect after closing data connection. This can be useful for totally broken ftp servers. Default is false. not me fixing broken servers, but okay. πŸŽ€
  • ftps:initial-prot (string) β€” specifies initial PROT setting for FTPS connections. Should be one of: C, S, E, P, or empty. Default is empty which means unknown, so that lftp will use PROT command unconditionally. If PROT command turns out to be unsupported, then Clear mode would be assumed. ⭐
  • hftp:cache (boolean) β€” allow server/proxy side caching for ftp-over-http protocol. πŸ“
  • hftp:cache-control (string) β€” specify corresponding HTTP request header. 🧚
  • hftp:decode (boolean) β€” when true, lftp automatically decodes the entity in hftp protocol when Content-Encoding header value matches deflate, gzip, compress, x-gzip or x-compress. πŸ’…
  • hftp:proxy (URL) β€” specifies HTTP proxy for FTP-over-HTTP protocol (hftp). The protocol hftp cannot work without a HTTP proxy, obviously. Default value is taken from environment variable ftp_proxy if it starts with http://, otherwise from environment variable http_proxy. If your FTP proxy requires authentication, specify user name and password in the URL. πŸ”₯
  • hftp:use-allprop (boolean) β€” if true, lftp will send <allprop/> request body in PROPFIND requests, otherwise it will send an empty request body. ✨
  • hftp:use-authorization (boolean) β€” if set to off, lftp will send password as part of URL to the proxy. This may be required for some proxies (e.g. M-soft). Default is on, and lftp will send password as part of Authorization header. 🫢
  • hftp:use-head (boolean) β€” if set to off, lftp will try to use GET instead of HEAD for hftp protocol. While this is slower, it may allow lftp to work with some proxies which don't understand or mishandle HEAD ftp:// requests. 🌸
  • hftp:use-mkcol (boolean) β€” if set to off, lftp will try to use PUT instead of MKCOL to create directories with hftp protocol. Default is off. πŸ’€
  • hftp:use-propfind (boolean) β€” if set to off, lftp will not try to use PROPFIND to get directory contents with hftp protocol and use GET instead. Default is off. When enabled, lftp will also use PROPPATCH to set file modification time after uploading. 🌈
  • hftp:use-range (boolean) β€” when true, lftp will use Range header for transfer restart. πŸ¦‹
  • hftp:use-type (boolean) β€” if set to off, lftp won't try to append ;type= to URLs passed to proxy. Some broken proxies don't handle it correctly. Default is on. πŸ’œ
  • http:accept, http:accept-charset, http:accept-encoding, http:accept-language (string) β€” specify corresponding HTTP request headers. πŸŽ€
  • http:authorization (string) β€” the authorization to use by default, when no user is specified. The format is user:password. Default is empty which means no authorization. ⭐
  • http:cache (boolean) β€” allow server/proxy side caching. πŸ“
  • http:cache-control (string) β€” specify corresponding HTTP request header. 🧚
  • http:cookie (string) β€” send this cookie to server. A closure is useful here:
set cookie/www.somehost.com "param=value"
  • http:decode (boolean) β€” when true, lftp automatically decodes the entity when Content-Encoding header value matches deflate, gzip, compress, x-gzip or x-compress. πŸ’…
  • http:post-content-type (string) β€” specifies value of Content-Type HTTP request header for POST method. Default is application/x-www-form-urlencoded. πŸ”₯
  • http:proxy (URL) β€” specifies HTTP proxy. It is used when lftp works over HTTP protocol. Default value is taken from environment variable http_proxy. If your proxy requires authentication, specify user name and password in the URL. ✨
  • http:put-method (PUT or POST) β€” specifies which HTTP method to use on put. 🫢
  • http:put-content-type (string) β€” specifies value of Content-Type HTTP request header for PUT method. 🌸
  • http:referer (string) β€” specifies value for Referer HTTP request header. Single dot . expands to current directory URL. Default is .. Set to empty string to disable Referer header. πŸ’€
  • http:set-cookies (boolean) β€” if true, lftp modifies http:cookie variables when Set-Cookie header is received. 🌈
  • http:use-allprop (boolean) β€” if true, lftp will send <allprop/> request body in PROPFIND requests, otherwise it will send an empty request body. πŸ¦‹
  • http:use-mkcol (boolean) β€” if set to off, lftp will try to use PUT instead of MKCOL to create directories with HTTP protocol. Default is on. πŸ’œ
  • http:use-propfind (boolean) β€” if set to off, lftp will not try to use PROPFIND to get directory contents with HTTP protocol and use GET instead. Default is off. When enabled, lftp will also use PROPPATCH to set Last-Modified property after a file upload. πŸŽ€
  • http:use-range (boolean) β€” when true, lftp will use Range header for transfer restart. ⭐
  • http:user-agent (string) β€” the string lftp sends in the User-Agent header of an HTTP request. your little hello-my-name-is πŸ’Œ
  • https:proxy (string) β€” specifies the https proxy. the default value is taken from the environment variable https_proxy. ✨
  • log:enabled (boolean) β€” when true, the log messages actually get output. heads up tho: the closure for this one (and every other log: variable) is either debug for debug messages or xfer for transfer logging. πŸͺ΅
  • log:file (string) β€” the target output file for logging. when it's empty, stderr gets used instead. πŸ“„
  • log:level (number) β€” the log verbosity level. rn it's only defined for the debug closure, so don't expect it to do anything anywhere else. πŸ”‰
  • log:max-size (number) β€” the maximum size of the log file. once that size is reached, the file gets renamed and started anew. bye old log πŸ‘‹
  • log:prefix-error (string)
  • log:prefix-note (string)
  • log:prefix-recv (string)
  • log:prefix-send (string)

these are the prefixes for the corresponding types of debug messages. πŸ’¬

  • log:show-ctx (boolean)
  • log:show-pid (boolean)
  • log:show-time (boolean)

these select additional information in the log messages. πŸ”


  • mirror:dereference (boolean) β€” when true, mirror dereferences symbolic links by default. you can override it with the --no-dereference option. default is false. πŸ”—
  • mirror:exclude-regex (regex) β€” specifies the default exclusion pattern. you can override it with the --include option. 🚫
  • mirror:include-regex (regex) β€” specifies the default inclusion pattern. it's used just after mirror:exclude-regex gets applied, and it is never used if mirror:exclude-regex is empty. never ever. ⚠️
  • mirror:no-empty-dirs (boolean) β€” when true, mirror doesn't create empty directories (just like the --no-empty-dirs option). no ghost towns πŸ‘»
  • mirror:sort-by (string) β€” specifies the order of file transfers. valid values are: name, name-desc, size, size-desc, date, date-desc. when the value is name or name-desc, the mirror:order setting also affects the order of transfers. πŸ“Š
  • mirror:order (list of patterns) β€” specifies the order of file transfers when sorting by name. e.g. setting this to "*.sfv *.sum" makes mirror transfer files matching *.sfv first, then the ones matching *.sum, and then all other files. wanna process directories after the other files? add "*/" to the end of the pattern list. πŸ“
  • mirror:overwrite (boolean) β€” when true, mirror overwrites plain files instead of removing and re-creating them. glow-up in place, no delete-and-rebuild ✨
  • mirror:parallel-directories (boolean) β€” if true, mirror starts processing several directories in parallel when it's in parallel mode. otherwise, it transfers files from a single directory before moving on to other directories. πŸƒβ€β™€οΈ
  • mirror:parallel-transfer-count (number) β€” specifies the number of parallel transfers mirror is allowed to start. you can override it with the --parallel option. a closure can be matched against source or target host names, and the minimum number greater than 0 is used. πŸ”’
  • mirror:require-source (boolean) β€” when true, mirror requires a source directory to be specified explicitly. otherwise it's supposed to be the current directory. πŸ“
  • mirror:set-permissions (boolean) β€” when set to off, mirror won't try to copy file and directory permissions. you can override it with the --perms option. default is on. πŸ”
  • mirror:skip-noaccess (boolean) β€” when true, mirror doesn't try to download files that are obviously inaccessible by the permission mask. default is false. πŸ™…β€β™€οΈ
  • mirror:use-pget-n (number) β€” specifies the -n option for the pget command used to transfer every single file under mirror. a closure can be matched against source or target host names, and the minimum number greater than 0 is used. when the value is less than 2, pget isn't used. ⚑
  • module:path (string) β€” a colon separated list of directories to look for modules. it can be initialized by the environment variable LFTP_MODULE_PATH. default is PKGLIBDIR/VERSION:PKGLIBDIR. πŸ“¦

  • net:connection-limit (number) β€” the maximum number of concurrent connections to the same site. 0 means unlimited. 🌐
  • net:connection-limit-timer (time interval) β€” increase the dynamic connection limit after this time interval. ⏲️
  • net:connection-takeover (boolean) β€” if true, foreground connections have priority over background ones and can interrupt background transfers to complete a foreground operation. main character energy, literally πŸ‘‘
  • net:idle (time interval) β€” disconnect from the server after this idle time. default is 3 minutes. πŸ’€
  • net:limit-rate (bytes per second) β€” limit the transfer rate on the data connection. 0 means unlimited. you can specify two numbers separated by a colon to limit the download and upload rate separately. suffixes are supported, e.g. 100K means 102400. 🐒
  • net:limit-max (bytes) β€” limit the accumulating of unused limit-rate. 0 means twice of limit-rate. πŸ“ˆ
  • net:limit-total-rate (bytes per second) β€” limit the transfer rate of all connections in sum. 0 means unlimited. you can specify two numbers separated by a colon to limit the download and upload rate separately. ⚠️ heads up: sockets have receive buffers on them, so the network link load can actually go higher than this rate limit right after a transfer begins. if that bothers you, try setting net:socket-buffer to a relatively small value to avoid it.
and psst β€” if you specify a closure, then the rate limitation gets applied to the sum of connections to a single matching host. 🫢
  • net:limit-total-max (bytes) β€” limit the accumulating of unused limit-total-rate. 0 means twice of limit-total-rate. πŸ“‰
  • net:max-retries (number) β€” the maximum number of sequential tries of an operation without success. 0 means unlimited. 1 means no retries. πŸ”
  • net:no-proxy (string) β€” contains a comma separated list of domains for which the proxy should not be used. the default is taken from the environment variable no_proxy. 🚷
  • net:persist-retries (number) β€” ignore this number of hard errors. super useful for logging into buggy FTP servers that reply 5xx when there are too many users. 😀
  • net:reconnect-interval-base (seconds) β€” sets the base minimal time between reconnects. the actual interval depends on net:reconnect-interval-multiplier and the number of attempts to perform an operation. ⏱️
  • net:reconnect-interval-max (seconds) β€” sets the maximum reconnect interval. when the current interval, after being multiplied by net:reconnect-interval-multiplier, reaches this value (or exceeds it), it's reset back to net:reconnect-interval-base. πŸ”„
  • net:reconnect-interval-multiplier (real number) β€” sets the multiplier by which the base interval is multiplied each time a new attempt to perform an operation fails. when the interval reaches the maximum, it's reset to the base value. see net:reconnect-interval-base and net:reconnect-interval-max. βœ–οΈ
  • net:socket-bind-ipv4 (ipv4 address) β€” bind all IPv4 sockets to the specified address. this is handy for selecting a specific network interface to use. default is empty, which means it doesn't bind IPv4 sockets at all β€” the operating system chooses an address automatically using the routing table. 🧭
  • net:socket-bind-ipv6 (ipv6 address) β€” same deal, but for IPv6 sockets. 🧭
  • net:socket-buffer (bytes) β€” use this size for the SO_SNDBUF and SO_RCVBUF socket options. 0 means the system default. 🧴
  • net:socket-maxseg (bytes) β€” use this size for the TCP_MAXSEG socket option. not all operating systems support this option, but Linux does. 🐧
  • net:timeout (time interval) β€” sets the network protocol timeout. ⏳
  • pget:default-n (number) β€” the default number of chunks to split the file into in pget. 🍰
  • pget:min-chunk-size (number) β€” the minimal chunk size to split the file into. 🍰
  • pget:save-status (time interval) β€” save the pget transfer status this often. set it to never to disable saving of the status file. the status gets saved to a file with the suffix .lftp-pget-status. πŸ’Ύ

  • sftp:auto-confirm (boolean) β€” when true, lftp answers "yes" to all ssh questions, in particular the question about a new host key. otherwise it answers "no". 🫑
  • sftp:charset (string) β€” the character set the SFTP server uses in file names and file listings. default is empty, which means the same as local. ⚠️ this setting is only used for SFTP protocol version prior to 4 β€” version 4 and later always use UTF-8. 🌍
  • sftp:connect-program (string) β€” the program to use for connecting to the remote server. it should support the -l option for user name and -p for port number. default is ssh -a -x. for private key authentication, add the -i option with the key file. πŸ”‘
  • sftp:max-packets-in-flight (number) β€” the maximum number of unreplied packets in flight. if round trip time is significant, you should increase this and size-read/size-write. default is 16. πŸ“¨
  • sftp:protocol-version (number) β€” the protocol number to negotiate. default is 6. the actual protocol version used depends on the server. 🀝
  • sftp:server-program (string) β€” the server program implementing the SFTP protocol. if it doesn't contain a slash /, it's considered a ssh2 subsystem and the -s option is used when starting connect-program. default is sftp. you can use rsh as a transport level protocol like this:
set sftp:connect-program rsh
set sftp:server-program /usr/libexec/openssh/sftp-server

similarly you can run SFTP over SSH1. 🌈

  • sftp:size-read (number) β€” block size for reading. default is 0x8000. πŸ“–
  • sftp:size-write (number) β€” block size for writing. default is 0x8000. ✍️

  • ssl:ca-file (path to file) β€” use the specified file as the Certificate Authority certificate. πŸ“œ
  • ssl:ca-path (path to directory) β€” use the specified directory as the Certificate Authority certificate repository (OpenSSL only). πŸ“‚
  • ssl:check-hostname (boolean) β€” when true, lftp checks if the host name used to connect to the server corresponds to the host name in its certificate. πŸ•΅οΈβ€β™€οΈ
  • ssl:crl-file (path to file) β€” use the specified file as the Certificate Revocation List certificate. πŸ“œ
  • ssl:crl-path (path to directory) β€” use the specified directory as the Certificate Revocation List certificate repository (OpenSSL only). πŸ“‚
  • ssl:key-file (path to file) β€” points at the file that's your private key. Heads up tho, this one only does anything for the ftps and https protocols πŸ’…. For sftp and fish you're gonna use sftp:connect-program and fish:connect-program instead (just toss the -i option at ssh, iykyk).
  • ssl:cert-file (path to file) β€” points at the file that's your certificate. That's it, that's the whole vibe ✨.
  • ssl:use-sni (boolean) β€” when it's true, lftp uses the Server Name Indication (SNI) TLS extension. Slay.
  • ssl:verify-certificate (boolean) β€” if you set it to yes, then lftp verifies that the server's certificate is signed by a known Certificate Authority and that it's not on the Certificate Revocation List. You can specify either a host name or a certificate fingerprint in the closure. No cap, that's the security check 🫢.
  • ssl:priority (string) β€” a free form priority string for GnuTLS. Example for TLS 1.2:
set ssl:priority "NORMAL:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:+VERS-TLS1.2:-VERS-TLS1.3"

If it was built with OpenSSL, an emulated version is - (+ has no effect) followed by SSL3.0, TLS1.0, TLS1.1, TLS1.2, separated by :. Example for TLS 1.3:

set ssl:priority "NORMAL:-SSL3.0:-TLS1.0:-TLS1.1:-TLS1.2"
  • torrent:ip (ipv4 address) β€” the IP address to send to the tracker. Set this if you're behind an HTTP proxy πŸ‘‘.
  • torrent:ipv6 (ipv6 address) β€” the IPv6 address to send to the tracker. By default, the first found global unicast address is used.
  • torrent:max-peers (number) β€” the max number of peers for a torrent. The least used peers get removed to keep it under this limit. It's giving crowd control fr fr.
  • torrent:port-range (from-to) β€” the port range to accept connections on. A single port is selected when a torrent starts.
  • torrent:retracker (URL) β€” an explicit retracker URL, e.g. http://retracker.local/announce.
  • torrent:save-metadata (boolean) β€” when true, lftp saves metadata of each torrent it works with to the ~/.local/share/lftp/torrent/md or ~/.lftp/torrent/md directory and loads it from there if necessary πŸ’Ύ.
  • torrent:seed-max-time (time interval) β€” the maximum seed time. After this period of time, a complete torrent shuts down independently of ratio. It can be set to infinity if needed.
  • torrent:seed-min-peers (number) β€” the minimum number of peers when the torrent is complete. If there are less, new peers are actively searched for πŸ”.
  • torrent:stop-min-ppr (real number) β€” the minimum per-piece-ratio to stop seeding. Use it to avoid a situation when a popular piece causes a quick raise of the total ratio.
  • torrent:stop-on-ratio (real number) β€” the torrent stops when it's complete and the ratio reached this number.
  • torrent:timeout (time interval) β€” the maximum time without any progress. When it's reached, the torrent shuts down πŸ’€.
  • torrent:use-dht (boolean) β€” when true, DHT is used.
  • xfer:auto-rename (boolean) β€” suggested filenames provided by the server are used if the user explicitly sets this option to on. Since this could be a security risk, the default is off. Not me warning you twice πŸ™ˆ.
  • xfer:backup-suffix (string) β€” a time format string (see strftime(3)) for the backup file name when replacing an existing file.
  • xfer:clobber (boolean) β€” if this setting is off, get commands will not overwrite existing files and generate an error instead.
  • xfer:destination-directory (path or URL to directory) β€” this setting is used as the default -O option for get and mget commands. Default is empty, which means current directory (no -O option).
  • xfer:disk-full-fatal (boolean) β€” when true, lftp aborts a transfer if it cannot write the target file because of full disk or quota; when false, lftp waits for disk space to be freed 🫢.
  • xfer:eta-period (seconds) β€” the period over which the weighted average rate is calculated to produce the ETA.
  • xfer:eta-terse (boolean) β€” show terse ETA (only high order parts). Default is true.
  • xfer:keep-backup (boolean) β€” when true, the backup file created before replacing an existing file is not removed after a successful transfer.
  • xfer:make-backup (boolean) β€” when true, lftp renames the pre-existing file adding xfer:backup-suffix instead of overwriting it.
  • xfer:max-redirections (number) β€” the maximum number of redirections. This can be useful for downloading over HTTP. 0 prohibits redirections.
  • xfer:parallel (number) β€” the default number of parallel transfers in a single get/put/mget/mput command.
  • xfer:rate-period (seconds) β€” the period over which the weighted average rate is calculated to be shown.
  • xfer:temp-file-name (string) β€” the temporary file name pattern; the first asterisk is replaced by the original file name.
  • xfer:timeout (time interval) β€” the maximum time without any transfer progress. It can be used to limit the maximum time to retry a transfer from a server that doesn't support transfer restart ⏳.
  • xfer:use-temp-file (boolean) β€” when true, a file will be transferred to a temporary file in the same directory and then renamed.
  • xfer:verify (boolean) β€” when true, verify-command is launched after a successful transfer to validate file integrity. A zero exit code of that command should indicate correctness of the file βœ….
  • xfer:verify-command (string) β€” the command to validate file integrity. The only argument is the path to the file.

The name of a variable can be abbreviated unless it becomes ambiguous. The prefix before : can be omitted too. You can set one variable several times for different closures, and thus you can get particular settings for a particular state. The closure is to be specified after the variable name separated with slash /.

The closure for dns:, net:, ftp:, http:, hftp: domain variables is currently just the host name as you specify it in the open command (with some exceptions where the closure is meaningless, e.g. dns:cache-size). For some cmd: domain variables the closure is the current URL without path. For log: domain variables the closure is either debug or xfer. For other variables it is not currently used. See examples in the sample lftp.conf.

Certain commands and settings take a time interval parameter. It has the format Nx[Nx...], where N is a time amount (floating point) and x is a time unit: d - days, h - hours, m - minutes, s - seconds. The default unit is second. E.g. 5h30m or 5.5h. Also the interval can be infinity, inf, never, forever - it means an infinite interval. E.g. sleep forever or set dns:cache-expire never.

Boolean settings can be one of (true, on, yes, 1, +) for a True value or one of (false, off, no, 0, -) for a False value.

Tri-boolean settings have either a boolean value or auto.

Integer settings can have a suffix: k - kibi, m - mebi, g - gigi, etc. They can also have a prefix: 0 - octal, 0x - hexadecimal.

πŸŒ€ FTP asynchronous mode (pipelining)

Lftp can speed up FTP operations by sending several commands at once and then checking all the responses. See the ftp:sync-mode variable. Sometimes this does not work, thus synchronous mode is the default. You can try to turn synchronous mode off and see if it works for you. It is known that some network software dealing with address translation works incorrectly in the case of several FTP commands in one network packet 😭.

RFC959 says:

``The user-process sending another command before the completion reply would be in violation of protocol; but server-FTP processes should queue any commands that arrive while a preceding command is in progress''.

Also, RFC1123 says:

``Implementors MUST NOT assume any correspondence between READ boundaries on the control connection and the Telnet EOL sequences (CR LF).''

and

``a single READ from the control connection may include more than one FTP command''.

So it must be safe to send several commands at once, which speeds up operation a lot and seems to work with all Unix and VMS based ftp servers. Unfortunately, windows based servers often cannot handle several commands in one packet, and so cannot some broken routers πŸ’€.


✨ OPTIONS ✨

  • -d β€” switch on debugging mode πŸ›.
  • -e commands β€” execute the given commands and don't exit.
  • -p port β€” use the given port to connect.
  • -u user[,pass] β€” use the given username and password to connect. Remember to quote the password properly in the shell. Also note that it is not secure to specify the password on the command line β€” use the ~/.netrc file or the LFTP_PASSWORD environment variable together with the --env-password option. Alternatively you can use ssh-based protocols with authorized keys, so you don't have to enter a password 🫢.
Girl, do not be putting your password on the command line where everybody and their group chat can see it. ~/.netrc, LFTP_PASSWORD + --env-password, or ssh keys. Periodt πŸ’….
  • --norc β€” don't execute rc files from the home directory.
  • --rcfile file β€” execute commands from the file. May be specified multiple times.
  • -f script_file β€” execute commands in the file and exit. This option must be used alone without other arguments (except --norc).
  • -c commands β€” execute the given commands and exit. Commands can be separated with a semicolon, && or ||. Remember to quote the commands argument properly in the shell. This option must be used alone without other arguments (except --norc).

Other open options may also be given on the lftp command line ✨.

🌿 ENVIRONMENT VARIABLES 🌿

okay so lftp lowkey reads a whole lil squad of environment variables, bestie. here's the full roster, no skips:

  • EDITOR β€” this is the local editor it grabs for the edit command. set it, love it. πŸ’–
  • HOME β€” used for local tilde (~) expansion. classic.
  • SHELL β€” the ! command peeks at this to figure out which shell to run.
  • PAGER β€” put the name of your pager here, bestie. it's what more and zmore use. πŸŽ€
  • http_proxy, https_proxy β€” these set the initial http:proxy, hftp:proxy and https:proxy variables. yes, https_proxy also feeds http:proxy β€” that's the whole point, don't fight it.
  • ftp_proxy β€” sets the initial ftp:proxy or hftp:proxy variable, and which one it picks depends on the URL protocol used in this environment variable. it's giving ✨decision making✨.
  • no_proxy β€” sets the initial net:no-proxy variable.
  • LFTP_MODULE_PATH β€” sets the initial module:path variable.
  • LFTP_HOME β€” this one locates the directory that stores your user-specific config files. if it's unset, ~/.lftp gets used. but β€” important β€” if that directory does not exist, then XDG directories get used instead. plot twist πŸ’€
  • LFTP_PASSWORD β€” used for the --env-password open option.
  • LS_COLORS β€” sets the initial color:dir-colors variable. yes it's the same vibe as your ls colors.
  • XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_CACHE_HOME β€” these locate the directories for user-specific files when ~/.lftp (or the $LFTP_HOME directory) does not exist. the defaults are ~/.config, ~/.local/share and ~/.cache respectively. the suffix /lftp gets appended to make the full path to the directories. slay πŸ¦‹

πŸ“ FILES πŸ“

where lftp keeps its stuff, and where it goes looking for yours:

  • /etc/lftp.conf β€” the system-wide startup file. the actual location depends on the --sysconfdir configure option. it's /etc when the prefix is /usr, and /usr/local/etc by default. πŸ‘‘
  • ~/.config/lftp/rc or ~/.lftp/rc, ~/.lftprc β€” these files get executed on lftp startup, right after /etc/lftp.conf. main character energy, honestly.
  • ~/.local/share/lftp/log or ~/.lftp/log β€” the file things get logged to when lftp moves into the background in nohup mode.
  • ~/.local/share/lftp/transfer_log or ~/.lftp/transfer_log β€” the file transfers get logged to when the log:enabled/xfer setting is set to yes. you can move it somewhere else with the log:file/xfer setting.
  • ~/.local/share/lftp/bookmarks or ~/.lftp/bookmarks β€” this is where lftp stores its bookmarks. see the bookmark command, iykyk πŸ”₯
  • ~/.local/share/lftp/cwd_history or ~/.lftp/cwd_history β€” stores the last working directories for every site you've visited. it remembers. πŸ™ˆ
  • ~/.local/share/lftp/bg/ or ~/.lftp/bg/ β€” this directory stores the named sockets for backgrounded lftp processes.
  • ~/.cache/lftp/DHT/ or ~/.lftp/DHT/ β€” stores the DHT id and nodes cache for IPv4 and IPv6. the file name suffix is the host name.
  • ~/.cache/lftp/edit/ or ~/.lftp/edit/ β€” stores temporary files for the edit command.
  • ~/.local/share/lftp/torrent/md/ or ~/.lftp/torrent/md/ β€” stores torrent metadata. especially useful for magnet links, since cached metadata can be loaded straight from the directory. it can also double as torrent history β€” the file names are the info_hash of torrents. πŸ“
  • ~/.netrc β€” this file gets consulted to grab the default login and password to a server when it's specified without a protocol to the open command. passwords are also searched here if you use a URL with a user name but with no password. ✨

πŸ‘€ SEE ALSO πŸ‘€

the required reading list, bestie. go forth and be educated:


🫢 AUTHOR 🫢

Alexander V. Lukyanov lav@yars.free.net


πŸ’œ ACKNOWLEDGMENTS πŸ’œ

This manual page was originally written by Christoph Lameter <clameter@debian.org>, for the Debian GNU/Linux system. πŸŽ€

The page was improved and updated later by Nicolas Lichtmaier <nick@Feedback.com.ar>, James Troup <J.J.Troup@comp.brad.ac.uk> and Alexander V. Lukyanov <lav@yars.free.net>.

the way that multiple people poured into this page over the years… we love a collaborative glow-up πŸ’…


and that's the whole page, bestie!! you made it all the way to the bottom, which is genuinely iconic of you 🌈 this manual is from lftp lftp(1), dated 11 June 2022 β€” so like, go open something and be your main character self. periodt. πŸ’–βœ¨