1lftp(1)                     General Commands Manual                    lftp(1)
2
3
4

NAME

6       lftp - Sophisticated file transfer program
7

SYNTAX

9       lftp [-d] [-e cmd] [-p port] [-u user[,pass]] [site]
10       lftp -f script_file
11       lftp -c commands
12       lftp --version
13       lftp --help
14
15

VERSION

17       This man page documents lftp version 4.4.6.
18
19

DESCRIPTION

21       lftp is a file transfer program that allows sophisticated FTP, HTTP and
22       other connections to other hosts. If site is specified then  lftp  will
23       connect  to that site otherwise a connection has to be established with
24       the open command.
25
26       lftp can handle several file access methods - FTP, FTPS,  HTTP,  HTTPS,
27       HFTP,  FISH, SFTP and file (HTTPS and FTPS are only available when lftp
28       is compiled with GNU TLS or  OpenSSL  library).  You  can  specify  the
29       method  to  use  in  `open  URL' command, e.g. `open http://www.us.ker
30       nel.org/pub/linux'. HFTP is ftp-over-http-proxy  protocol.  It  can  be
31       used   automatically   instead   of   FTP   if   ftp:proxy  is  set  to
32       `http://proxy[:port]'. Fish is a protocol working over an  ssh  connec‐
33       tion  to a unix account. SFtp is a protocol implemented in SSH2 as SFTP
34       subsystem.
35
36       Besides FTP-like protocols, lftp has support for BitTorrent protocol as
37       `torrent' command. Seeding is also supported.
38
39
40       Every  operation  in  lftp  is reliable, that is any not-fatal error is
41       ignored and the operation is repeated. So  if  downloading  breaks,  it
42       will be restarted from the point automatically. Even if FTP server does
43       not support the REST command, lftp will try to retrieve the  file  from
44       the very beginning until the file is transferred completely.
45
46       lftp  has shell-like command syntax allowing you to launch several com‐
47       mands in parallel in background (&). It is also possible to group  com‐
48       mands within () and execute them in background. All background jobs are
49       executed in the same single process. You can bring a foreground job  to
50       background with ^Z (c-z) and back with command `wait' (or `fg' which is
51       alias to `wait'). To list running jobs, use command `jobs'.  Some  com‐
52       mands allow redirecting their output (cat, ls, ...) to file or via pipe
53       to external command. Commands can be executed  conditionally  based  on
54       termination status of previous command (&&, ||).
55
56       If  you  exit lftp before all jobs are not finished yet, lftp will move
57       itself to nohup mode in background. The same thing happens with a  real
58       modem hangup or when you close an xterm.
59
60       lftp has built-in mirror which can download or update a whole directory
61       tree. There is also reverse mirror (mirror -R) which uploads or updates
62       a  directory  tree  on  server. Mirror can also synchronize directories
63       between two remote servers, using FXP if available.
64
65       There is command `at' to launch a job at specified time in current con‐
66       text,  command  `queue'  to queue commands for sequential execution for
67       current server, and much more.
68
69       On  startup,  lftp  executes  /etc/lftp.conf  and  then  ~/.lftprc  and
70       ~/.lftp/rc. You can place aliases and `set' commands there. Some people
71       prefer to see full protocol debug, use `debug' to turn  the  debug  on.
72       Use `debug 3' to see only greeting messages and error messages.
73
74       lftp  has  a  number of settable variables. You can use `set -a' to see
75       all variables and their values or `set -d' to  see  list  of  defaults.
76       Variable  names can be abbreviated and prefix can be omitted unless the
77       rest becomes ambiguous.
78
79       If  lftp  was  compiled  with  OpenSSL  (configure  --with-openssl)  it
80       includes  software  developed  by  the  OpenSSL  Project for use in the
81       OpenSSL Toolkit. (http://www.openssl.org/)
82
83
84   Commands
85       ! shell command
86
87       Launch shell or shell command.
88
89            !ls
90
91       To do a directory listing of the local host.
92
93       alias  [name [value]]
94
95       Define or undefine alias name. If value is omitted, the alias is  unde‐
96       fined,  else it takes the value value. If no argument is given the cur‐
97       rent aliases are listed.
98
99            alias dir ls -lF
100            alias less zmore
101
102       at time [ -- command ]
103
104       Wait until the given time and execute  given  (optional)  command.  See
105       also at(1).
106
107       attach  [PID]
108
109       Attach the terminal to specified backgrounded lftp process.
110
111       bookmark  [subcommand]
112
113       The bookmark command controls bookmarks.
114
115       Site  names  can  be  used in the open command directly as-is or in any
116       command that accepts input URLs using the bm:site/path format.
117
118            add <name> [<loc>]   add current place or given location to  book‐
119                                 marks and bind to given name
120            del <name>           remove bookmark with name
121            edit                 start editor on bookmarks file
122            import <type>        import foreign bookmarks
123            list                 list bookmarks (default)
124
125       cache  [subcommand]
126
127       The  cache  command controls local memory cache.  The following subcom‐
128       mands are recognized:
129
130            stat        print cache status (default)
131            on|off      turn on/off caching
132
133            flush       flush cache
134            size lim    set memory limit, -1 means unlimited
135            expire Nx   set cache expiration time to N seconds  (x=s)  minutes
136                        (x=m) hours (x=h) or days (x=d)
137
138       cat files
139
140       cat  outputs  the  remote  file(s) to stdout.  (See also more, zcat and
141       zmore)
142
143       cd rdir
144
145       Change current remote directory.   The  previous  remote  directory  is
146       stored  as  `-'.  You  can do `cd -' to change the directory back.  The
147       previous directory for each site is also stored on disk, so you can  do
148       `open site; cd -' even after lftp restart.
149
150       chmod mode files
151
152       Change  permission mask on remote files. The mode must be an octal num‐
153       ber.
154
155       close [-a]
156
157       Close idle connections.  By default only with the current  server,  use
158       -a to close all idle connections.
159
160       cls [OPTS] files...
161
162       `cls'  tries  to retrieve information about specified files or directo‐
163       ries and outputs the information according to format options. The  dif‐
164       ference between `ls' and `cls' is that `ls' requests the server to for‐
165       mat file listing, and `cls' formats it itself, after retrieving all the
166       needed information.  See `help cls' for options.
167
168       command cmd args...
169
170       execute given command ignoring aliases.
171
172       debug [-o file] level|off
173
174       Switch debugging to level or turn it off.  Use -o to redirect the debug
175       output to a file.
176
177       echo [-n] string
178
179       Prints (echos) the given string to the display.
180
181       eval [-f format ] args...
182
183       without -f it executes given arguments as a command. With -f, arguments
184       are  transformed  into a new command. The format can contain plain text
185       and placeholders $0...$9 and $@, corresponding to the arguments.
186
187       exit [bg] [top] [kill] [code]
188
189       exit will exit from lftp or move to  background  if  there  are  active
190       jobs. If no job is active, code is passed to operating system as lftp's
191       termination status. If code is omitted, the exit code of  last  command
192       is used.
193
194       `exit  bg'  forces  moving  to  background  when cmd:move-background is
195       false.  `exit top' makes  top  level  `shell'  (internal  lftp  command
196       executor)  terminate.  `exit kill' kills all numbered jobs before exit‐
197       ing. The options can be combined, e.g.  `at 08:00 -- exit top  kill  &'
198       kills all jobs and makes lftp exit at specified time.
199
200       fg
201
202       Alias for `wait'.
203
204       find  [directory]
205
206       List files in the directory (current directory by default) recursively.
207       This can help with servers lacking ls -R support. You can redirect out‐
208       put of this command.
209
210       ftpcopy
211
212       Obsolete. Use one of the following instead:
213            get ftp://... -o ftp://...
214            get -O ftp://... file1 file2...
215            put ftp://...
216            mput ftp://.../*
217            mget -O ftp://... ftp://.../*
218       or  other  combinations  to  get FXP transfer (directly between two FTP
219       servers).  lftp would fallback to plain copy (via client) if FXP trans‐
220       fer cannot be initiated or ftp:use-fxp is false.
221
222       get [-E] [-a] [-c] [-e] [-O base] rfile [-o lfile] ...
223
224       Retrieve  the  remote  file rfile and store it as the local file lfile.
225       If -o is omitted, the file is stored to local file named as  base  name
226       of  rfile.  You can get multiple files by specifying multiple instances
227       of rfile (and -o lfile). Does not expand wildcards, use mget for that.
228
229            -c          continue, reget
230            -E          delete source files after successful transfer
231            -e          delete target file before the transfer
232            -a          use ascii mode (binary is the default)
233            -O <base>   specifies base directory or URL where files should  be
234                        placed
235
236       Examples:
237            get README
238            get README -o debian.README
239            get README README.mirrors
240            get README -o debian.README README.mirrors -o debian.mirrors
241            get README -o ftp://some.host.org/debian.README
242            get README -o ftp://some.host.org/debian-dir/   (end slash is important)
243
244       get1 [OPTS] rfile
245
246       Transfer a single file. Options:
247
248            -o <lfile>                  destination file name (default - base‐
249                                        name of rfile)
250            -c                          continue, reget
251            -E                          delete source files  after  successful
252                                        transfer
253            -a                          use ascii mode (binary is the default)
254            --source-region=<from-to>   transfer  specified  region  of source
255                                        file
256            --target-position=<pos>     position in target file to write  data
257                                        at
258
259       glob [-d] [-a] [-f] command patterns
260
261       Glob  given patterns containing metacharacters and pass result to given
262       command.  E.g. ``glob echo *''.
263
264
265            -f   plain files (default)
266            -d   directories
267            -a   all types
268
269       help [cmd]
270
271       Print help for cmd or if no cmd was specified print a list of available
272       commands.
273
274       jobs [-v] [job_no...]
275
276       List  running  jobs. -v means verbose, several -v can be specified.  If
277       job_no is specified, only list a job with that number.
278
279       kill all|job_no
280
281       Delete specified job with job_no or all jobs.  (For job_no see jobs)
282
283       lcd ldir
284
285       Change current local directory ldir. The previous  local  directory  is
286       stored as `-'. You can do `lcd -' to change the directory back.
287
288       ln [-s] existing-file new-link
289
290       Make  a hard/symbolic link to an existing file.  Option -s selects cre‐
291       ation of a symbolic link.
292
293       local command
294
295       Run specified command with local directory file:// session  instead  of
296       remote session. Examples:
297            local pwd
298            local ls
299            local mirror /dir1 /dir2
300
301       lpwd
302
303       Print current working directory on local machine.
304
305       ls params
306
307       List  remote  files. You can redirect output of this command to file or
308       via pipe to external command.  By default, ls output is cached, to  see
309       new listing use rels or cache flush.
310
311       mget [-c] [-d] [-a] [-E] [-O base] files
312
313       Gets selected files with expanded wildcards.
314
315            -c          continue, reget.
316            -d          create  directories the same as file names and get the
317                        files into them instead of current directory.
318            -E          delete source files after successful transfer
319            -a          use ascii mode (binary is the default)
320            -O <base>   specifies base directory or URL where files should  be
321                        placed
322
323       mirror [OPTS] [source [target]]
324
325       Mirror  specified source directory to local target directory. If target
326       directory ends with a slash, the source base name is appended to target
327       directory  name.  Source and/or target can be URLs pointing to directo‐
328       ries.
329
330            -c,    --continue                continue a mirror job if possible
331            -e,    --delete                  delete  files  not   present   at
332                                             remote site
333                   --delete-first            delete old files before transfer‐
334                                             ring new ones
335                   --depth-first             descend    into    subdirectories
336                                             before transferring files
337            -s,    --allow-suid              set  suid/sgid  bits according to
338                                             remote site
339                   --allow-chown             try to set  owner  and  group  on
340                                             files
341                   --ascii                   use ascii mode transfers (implies
342                                             --ignore-size)
343                   --ignore-time             ignore time when deciding whether
344                                             to download
345                   --ignore-size             ignore size when deciding whether
346                                             to download
347                   --only-missing            download only missing files
348                   --only-existing           download   only   files   already
349                                             existing at target
350            -n,    --only-newer              download  only  newer  files  (-c
351                                             won't work)
352                   --no-empty-dirs           don't  create  empty  directories
353                                             (implies --depth-first)
354            -r,    --no-recursion            don't go to subdirectories
355                   --no-symlinks             don't create symbolic links
356            -p,    --no-perms                don't set file permissions
357                   --no-umask                don't apply umask to file modes
358            -R,    --reverse                 reverse mirror (put files)
359            -L,    --dereference             download symbolic links as files
360            -N,    --newer-than=SPEC         download  only  files  newer than
361                                             specified time
362                   --on-change=CMD           execute the command  if  anything
363                                             has been changed
364                   --older-than=SPEC         download  only  files  older than
365                                             specified time
366                   --size-range=RANGE        download only files with size  in
367                                             specified range
368            -P,    --parallel[=N]            download N files in parallel
369                   --use-pget[-n=N]          use pget to transfer every single
370                                             file
371                   --loop                    loop until no changes found
372            -i RX, --include RX              include matching files
373            -x RX, --exclude RX              exclude matching files
374            -I GP, --include-glob GP         include matching files
375            -X GP, --exclude-glob GP         exclude matching files
376            -v,    --verbose[=level]         verbose operation
377                   --log=FILE                write lftp  commands  being  exe‐
378                                             cuted to FILE
379                   --script=FILE             write  lftp commands to FILE, but
380                                             don't execute them
381                   --just-print, --dry-run   same as --script=-
382                   --use-cache               use cached directory listings
383                   --Remove-source-files     remove files after transfer  (use
384                                             with caution)
385            -a                               same  as  --allow-chown  --allow-
386                                             suid --no-umask
387
388       When using -R, the first directory is local and the second  is  remote.
389       If  the  second  directory  is omitted, base name of first directory is
390       used.  If both directories are omitted, current local and remote direc‐
391       tories  are  used.   If target directory ends with a slash (except root
392       directory) then base name of source directory is appended.
393
394       RX is an extended regular expression, just like in egrep(1).
395
396       GP is a glob pattern, e.g. `*.zip'.
397
398       Include and exclude options can be specified multiple times.  It  means
399       that a file or directory would be mirrored if it matches an include and
400       does not match to excludes after the include, or does  not  match  any‐
401       thing  and  the  first check is exclude. Directories are matched with a
402       slash appended.
403
404       Note that symbolic links are  not  created  when  uploading  to  remote
405       server,  because  FTP  protocol cannot do it. To upload files the links
406       refer to, use `mirror -RL' command (treat symbolic links as files).
407
408       For options --newer-than and --older-than you can either specify a file
409       or   time   specification   like  that  used  by  at(1)  command,  e.g.
410       `now-7days' or `week ago'. If you specify  a  file,  then  modification
411       time of that file will be used.
412
413       Verbosity level can be selected using --verbose=level option or by sev‐
414       eral -v options, e.g. -vvv. Levels are:
415            0 - no output (default)
416            1 - print actions
417            2 - +print not deleted file names (when -e is not specified)
418            3 - +print directory names which are mirrored
419
420       --only-newer turns off file size comparison and uploads/downloads  only
421       newer  files  even  if  size  is  different. By default older files are
422       transferred and replace newer ones.
423
424       You can mirror between two servers  if  you  specify  URLs  instead  of
425       directories.   FXP  is  automatically  used  for  transfers between FTP
426       servers, if possible.
427
428       Some FTP servers hide dot-files by default (e.g. .htaccess),  and  show
429       them only when LIST command is used with -a option. In such case try to
430       use `set ftp:list-options -a'.
431
432       mkdir [-p] dir(s)
433
434       Make remote directories. If -p is used, make all components of paths.
435
436       module module [ args ]
437
438       Load given module using dlopen(3) function. If  module  name  does  not
439       contain a slash, it is searched in directories specified by module:path
440       variable.   Arguments  are  passed   to   module_init   function.   See
441       README.modules for technical details.
442
443       more files
444
445       Same  as  `cat  files  |  more'. if PAGER is set, it is used as filter.
446       (See also cat, zcat and zmore)
447
448       mput [-c] [-d] [-a] [-E] [-O base] files
449
450       Upload files with wildcard expansion. By default it uses the base  name
451       of local name as remote one. This can be changed by `-d' option.
452
453            -c          continue, reput
454            -d          create  directories  the same as in file names and put
455                        the files into them instead of current directory
456            -E          delete source files after successful transfer (danger‐
457                        ous)
458            -a          use ascii mode (binary is the default)
459            -O <base>   specifies  base directory or URL where files should be
460                        placed
461
462       mrm file(s)
463
464       Same as `glob rm'. Removes specified file(s) with wildcard expansion.
465
466       mv file1 file2
467
468       Rename file1 to file2.
469
470       nlist [args]
471
472       List remote file names
473
474       open [-e cmd] [-u user[,pass]] [-p port] host|url
475
476       Select a FTP server.
477
478       pget [OPTS] rfile [-o lfile]
479
480       Gets the specified file using several connections. This  can  speed  up
481       transfer,  but  loads the net and server heavily impacting other users.
482       Use only if you really have to transfer the file ASAP.  Options:
483
484            -c           continue  transfer.  Requires  lfile.lftp-pget-status
485                         file.
486            -n maxconn   set  maximum  number of connections (default is taken
487                         from pget:default-n setting)
488
489       put [-E] [-a] [-c] [-O base] lfile [-o rfile]
490
491       Upload lfile with remote name rfile. If -o omitted, the  base  name  of
492       lfile  is  used as remote name. Does not expand wildcards, use mput for
493       that.
494
495            -o <rfile>   specifies remote file name  (default  -  basename  of
496                         lfile)
497            -c           continue,  reput. It requires permission to overwrite
498                         remote files
499            -E           delete source files after successful  transfer  (dan‐
500                         gerous)
501            -a           use ascii mode (binary is the default)
502            -O <base>    specifies base directory or URL where files should be
503                         placed
504
505       pwd [-p]
506
507       Print current remote URL. Use `-p' option to show password in the URL.
508
509       queue [-n num ] cmd
510
511       Add the given command to queue for sequential execution. Each site  has
512       its  own  queue.  `-n'  adds  the  command before the given item in the
513       queue. Don't try to queue `cd' or `lcd' commands, it may confuse  lftp.
514       Instead  do the cd/lcd before `queue' command, and it will remember the
515       place in which the command is to be done. It is possible to queue up an
516       already  running job by `queue wait <jobno>', but the job will continue
517       execution even if it is not the first in queue.
518
519       `queue stop' will stop the queue, it will not execute any new commands,
520       but already running jobs will continue to run. You can use `queue stop'
521       to create an empty stopped queue. `queue start' will resume queue  exe‐
522       cution.  When you exit lftp, it will start all stopped queues automati‐
523       cally.
524
525       `queue' with no arguments will either create a stopped queue  or  print
526       queue status.
527
528       queue --delete|-d [index or wildcard expression]
529
530       Delete  one  or more items from the queue. If no argument is given, the
531       last entry in the queue is deleted.
532
533       queue --move|-m <index or wildcard expression> [index]
534
535       Move the given items before the given queue index, or to the end if  no
536       destination is given.
537
538            -q   Be quiet.
539            -v   Be verbose.
540            -Q   Output  in a format that can be used to re-queue. Useful with
541                 --delete.
542
543       Examples:
544            > get file &
545            [1] get file
546            > queue wait 1
547            > queue get another_file
548            > cd a_directory
549            > queue get yet_another_file
550
551            queue -d 3             Delete the third item in the queue.
552            queue -m 6 4           Move the sixth item in the queue before the
553                                   fourth.
554            queue -m "get*zip" 1   Move all commands matching "get*zip" to the
555                                   beginning of the queue.  (The order of  the
556                                   items is preserved.)
557            queue -d "get*zip"     Delete all commands matching "get*zip".
558
559       quote cmd
560
561       For  FTP  -  send  the command uninterpreted. Use with caution - it can
562       lead to unknown remote state and thus will cause reconnect. You  cannot
563       be  sure  that  any change of remote state because of quoted command is
564       solid - it can be reset by reconnect at any time.
565
566       For  HTTP  -  specific  to  HTTP  action.  Syntax:  ``quote   <command>
567       [<args>]''.  Command may be ``set-cookie'' or ``post''.
568            open http://www.site.net
569            quote set-cookie "variable=value; othervar=othervalue"
570            set http:post-content-type application/x-www-form-urlencoded
571            quote post /cgi-bin/script.cgi "var=value&othervar=othervalue" > local_file
572
573       For  FISH - send the command uninterpreted. This can be used to execute
574       arbitrary commands on server. The command must not take input or  print
575       ###  at new line beginning. If it does, the protocol will become out of
576       sync.
577            open fish://server
578            quote find -name \*.zip
579
580       reget rfile [-o lfile]
581
582       Same as `get -c'.
583
584       rels [args]
585
586       Same as `ls', but ignores the cache.
587
588       renlist [args]
589
590       Same as `nlist', but ignores the cache.
591
592       repeat [OPTS] [[-d] delay] [command]
593
594       Repeat specified command with  a  delay  between  iterations.   Default
595       delay is one second, default command is empty.
596
597            -c <count>    maximum number of iterations
598            -d <delay>    delay between iterations
599            --while-ok    stop when command exits with non-zero code
600            --until-ok    stop when command exits with zero code
601            --weak        stop when lftp moves to background.
602
603       Examples:
604            repeat at tomorrow -- mirror
605            repeat 1d mirror
606
607       reput lfile [-o rfile]
608
609       Same as `put -c'.
610
611       rm [-r] [-f] files
612
613       Remove  remote  files.  Does not expand wildcards, use mrm for that. -r
614       is for recursive directory remove. Be careful, if something goes  wrong
615       you can lose files. -f suppress error messages.
616
617       rmdir dir(s)
618
619       Remove remote directories.
620
621       scache [session]
622
623       List cached sessions or switch to specified session.
624
625       set [var [val]]
626
627       Set  variable  to given value. If the value is omitted, unset the vari‐
628       able.  Variable name has format  ``name/closure'',  where  closure  can
629       specify  exact  application  of the setting. See below for details.  If
630       set is called with no variable then only altered settings  are  listed.
631       It can be changed by options:
632
633            -a   list all settings, including default values
634            -d   list only default values, not necessary current ones
635
636       site site_cmd
637
638       Execute  site command site_cmd and output the result.  You can redirect
639       its output.
640
641       sleep interval
642
643       Sleep given time interval and exit. Interval is in seconds by  default,
644       but  can  be  suffixed  with  'm', 'h', 'd' for minutes, hours and days
645       respectively.  See also at.
646
647       slot [name]
648
649       Select specified slot or list all slots allocated. A slot is a  connec‐
650       tion  to a server, somewhat like a virtual console. You can create mul‐
651       tiple slots connected to different servers and switch between them. You
652       can  also  use  slot:name as a pseudo-URL evaluating to that slot loca‐
653       tion.
654
655       Default readline binding allows quick switching between slots named 0-9
656       using Meta-0 - Meta-9 keys (often you can use Alt instead of Meta).
657
658       source file
659       source -e command
660
661       Execute  commands recorded in file file or returned by specified exter‐
662       nal command.
663            source ~/.lftp/rc
664            source -e echo help
665
666       suspend
667
668       Stop lftp process. Note that transfers will be also stopped  until  you
669       continue the process with shell's fg or bg commands.
670
671       torrent [OPTS] torrent-files...
672
673       Start  BitTorrent  process  for the given torrent-files, which can be a
674       local file, URL, magnet link or plain info_hash written in hex.   Local
675       wildcards  are  expanded.  Existing  files  are  first validated unless
676       --force-valid option is given. Missing pieces are downloaded. Files are
677       stored  in specified directory or current working directory by default.
678       Seeding continues until ratio reachs torrent:stop-on-ratio  setting  or
679       time of torrent:seed-max-time outs.
680
681       Options:
682
683            -O <directory>           specifies   base  directory  where  files
684                                     should be placed
685            --force-valid            skip file validation  (if  you  are  sure
686                                     they are ok).
687            --dht-bootstrap=<node>   bootstrap DHT by sending a query to spec‐
688                                     ified    node.     E.g.     dht.transmis‐
689                                     sionbt.com:6881.   This  option should be
690                                     used just once to fill local node cache.
691
692       user user [pass]
693       user URL [pass]
694
695       Use specified info for remote login. If you specify an  URL  with  user
696       name, the entered password will be cached so that future URL references
697       can use it.
698
699       version
700
701       Print lftp version.
702
703       wait [jobno]
704       wait all
705
706       Wait for specified job to terminate. If jobno is omitted, wait for last
707       backgrounded job.
708
709       `wait all' waits for all jobs to terminate.
710
711       zcat files
712
713       Same as cat, but filter each file through zcat. (See also cat, more and
714       zmore)
715
716       zmore files
717
718       Same as more, but filter each file through zcat. (See  also  cat,  zcat
719       and more)
720
721
722   Settings
723       On  startup,  lftp  executes  ~/.lftprc  and ~/.lftp/rc.  You can place
724       aliases and `set' commands there. Some people prefer to see full proto‐
725       col debug, use `debug' to turn the debug on.
726
727       There  is also a system-wide startup file in /etc/lftp.conf.  It can be
728       in different directory, see FILES section.
729
730       lftp has the following settable variables (you can also use `set -a' to
731       see all variables and their values):
732
733       bmk:save-passwords (boolean)
734              save plain text passwords in ~/.lftp/bookmarks on `bookmark add'
735              command.  Off by default.
736
737       cache:cache-empty-listings (boolean)
738              When false, empty listings are not cached.
739
740       cache:enable (boolean)
741              When false, cache is disabled.
742
743       cache:expire (time interval)
744              Positive cache entries expire in this time interval.
745
746       cache:expire-negative (time interval)
747              Negative cache entries expire in this time interval.
748
749       cache:size (number)
750              Maximum cache size. When exceeded, oldest cache entries will  be
751              removed from cache.
752
753       cmd:at-exit (string)
754              the  commands  in string are executed before lftp exits or moves
755              to background.
756
757       cmd:at-exit-bg (string)
758              the commands in string are  executed  before  backgrounded  lftp
759              exits.
760
761       cmd:at-exit-fg (string)
762              the  commands  in  string  are  executed  before foreground lftp
763              exits.
764
765       cmd:at-background (string)
766              the commands in string are executed before lftp moves  to  back‐
767              ground.
768
769       cmd:at-terminate (string)
770              the  commands  in  string  are  executed  before lftp terminates
771              (either backgrounded or foreground).
772
773       cmd:at-finish (string)
774              the commands in string are executed once when all jobs are done.
775
776       cmd:at-queue-finish (string)
777              the commands in string are executed once  when  all  jobs  in  a
778              queue are done.
779
780       cmd:cls-completion-default (string)
781              default cls options for displaying completion choices. For exam‐
782              ple, to make completion listings show file sizes,  set  cmd:cls-
783              completion-default to `-s'.
784
785       cmd:cls-default (string)
786              default  cls  command options. They can be overridden by explic‐
787              itly given options.
788
789       cmd:cls-exact-time (boolean)
790              when true, cls would try to get  exact  file  modification  time
791              even if it means more requests to the server.
792
793       cmd:csh-history (boolean)
794              enables csh-like history expansion.
795
796       cmd:default-protocol (string)
797              The  value is used when `open' is used with just host name with‐
798              out protocol. Default is `ftp'.
799
800       cmd:fail-exit (boolean)
801              if true, exit when an unconditional (without || and && at begin)
802              command fails.
803
804       cmd:interactive (tri-boolean)
805              when true, lftp acts interactively, handles terminal signals and
806              outputs some extra messages. Default  is  auto  and  depends  on
807              stdin being a terminal.
808
809       cmd:long-running (seconds)
810              time  of  command execution, which is considered as `long' and a
811              beep is done before next prompt. 0 means off.
812
813       cmd:ls-default (string)
814              default ls argument
815
816       cmd:move-background (boolean)
817              when false, lftp refuses to go to background  when  exiting.  To
818              force it, use `exit bg'.
819
820       cmd:move-background-detach (boolean)
821              when  true (default), lftp detaches itself from the control ter‐
822              minal when moving to background, it is possible to  attach  back
823              using  `attach'  command;  when  false, lftp tricks the shell to
824              move lftp to background process group and continues to run, then
825              fg  shell  command  brings lftp back to foreground unless it has
826              done all jobs and terminated.
827
828       cmd:prompt (string)
829              The prompt. lftp recognizes the following backslash-escaped spe‐
830              cial characters that are decoded as follows:
831              \@     insert @ if current user is not default
832              \a     an ASCII bell character (07)
833              \e     an ASCII escape character (033)
834              \h     the hostname you are connected to
835              \n     newline
836              \s     the name of the client (lftp)
837              \S     current slot name
838              \u     the username of the user you are logged in as
839              \U     the     URL     of     the     remote     site     (e.g.,
840                     ftp://g437.ub.gu.se/home/james/src/lftp)
841              \v     the version of lftp (e.g., 2.0.3)
842              \w     the current working directory at the remote site
843              \W     the base name of the current  working  directory  at  the
844                     remote site
845              \nnn   the character corresponding to the octal number nnn
846              \\     a backslash
847              \?     skips next character if previous substitution was empty.
848              \[     begin  a sequence of non-printing characters, which could
849                     be used to embed a terminal  control  sequence  into  the
850                     prompt
851              \]     end a sequence of non-printing characters
852
853
854       cmd:parallel (number)
855              Number  of  jobs  run  in  parallel in non-interactive mode. For
856              example, this may be useful for scripts with multiple `get' com‐
857              mands.  Note that setting this to a value greater than 1 changes
858              conditional execution behaviour, basically  makes  it  inconsis‐
859              tent.
860
861       cmd:queue-parallel (number)
862              Number of jobs run in parallel in a queue.
863
864       cmd:remote-completion (boolean)
865              a boolean to control whether or not lftp uses remote completion.
866              When true, Tab key guesses if the word being completed should be
867              a  remote  file name. Meta-Tab does remote completion always. So
868              you can force remote completion with Meta-Tab  when  cmd:remote-
869              completion is false or when the guess is wrong.
870
871       cmd:save-cwd-history (boolean)
872              when  true, lftp saves last CWD of each site to ~/.lftp/cwd_his‐
873              tory, allowing to do ``cd -'' after  lftp  restart.  Default  is
874              true.
875
876       cmd:save-rl-history (boolean)
877              when  true, lftp saves readline history to ~/.lftp/rl_history on
878              exit.  Default is true.
879
880       cmd:show-status (booleam)
881              when false, lftp does not show status line on terminal.  Default
882              is true.
883
884       cmd:set-term-status (boolean)
885              when  true,  lftp  updates  terminal  status  if supported (e.g.
886              xterm). The closure for this setting is the terminal  type  from
887              TERM environment variable.
888
889       cmd:status-interval (timeinterval)
890              the time interval between status updates.
891
892       cmd:stifle-rl-history (number)
893              the number of lines to keep in readline history.
894
895       cmd:term-status (string)
896              the format string to use to display terminal status. The closure
897              for this setting is the  terminal  type  from  TERM  environment
898              variable. Default uses ``tsl'' and ``fsl'' termcap values.
899
900              The following escapes are supported:
901
902                   \a   bell
903                   \e   escape
904                   \n   new line
905                   \s   "lftp"
906                   \v   lftp version
907                   \T   the status string
908
909       cmd:time-style (string)
910              This setting is the default value for cls --time-style option.
911
912       cmd:trace (boolean)
913              when true, lftp prints the commands it executes (like sh -x).
914
915       cmd:verify-host (boolean)
916              if  true, lftp resolves host name immediately in `open' command.
917              It is also possible to skip the check for a single  `open'  com‐
918              mand if `&' is given, or if ^Z is pressed during the check.
919
920       cmd:verify-path (boolean)
921              if true, lftp checks the path given in `cd' command.  It is also
922              possible to skip the check for a single `cd' command if  `&'  is
923              given, or if ^Z is pressed during the check.  Examples:
924                   set cmd:verify-path/hftp://* false
925                   cd directory &
926
927       cmd:verify-path-cached (boolean)
928              When  false,  `cd'  to  a directory known from cache as existent
929              will  succeed  immediately.   Otherwise  the  verification  will
930              depend on cmd:verify-path setting.
931
932       color:use-color (tri-boolean)
933              when  true, cls command and completion output colored file list‐
934              ings according to color:dir-colors setting.  When set  to  auto,
935              colors are used when output is a terminal.
936
937       color:dir-colors (string)
938              file  listing color description. By default the value of LS_COL‐
939              ORS environment variable is used. See dircolors(1).
940
941       dns:SRV-query (boolean)
942              query for SRV records and use them before gethostbyname. The SRV
943              records  are  only used if port is not explicitly specified. See
944              RFC2052 for details.
945
946       dns:cache-enable (boolean)
947              enable DNS cache. If it is off, lftp  resolves  host  name  each
948              time it reconnects.
949
950       dns:cache-expire (time interval)
951              time  to  live  for  DNS  cache  entries.  It  has  format <num‐
952              ber><unit>+, e.g.  1d12h30m5s or just 36h.  To  disable  expira‐
953              tion, set it to `inf' or `never'.
954
955       dns:cache-size (number)
956              maximum number of DNS cache entries.
957
958       dns:fatal-timeout (time interval)
959              limit the time for DNS queries. If DNS server is unavailable too
960              long, lftp will fail to  resolve  a  given  host  name.  Set  to
961              `never' to disable.
962
963       dns:order (list of protocol names)
964              sets  the  order of DNS queries. Default is ``inet6 inet'' which
965              means first look up address in inet6 family, then inet  and  use
966              them  in  that  order.  To disable inet6 (AAAA) lookup, set this
967              variable to ``inet''.
968
969       dns:use-fork (boolean)
970              if true, lftp will fork before resolving host  address.  Default
971              is true.
972
973       dns:max-retries (number)
974              If  zero, there is no limit on the number of times lftp will try
975              to lookup an address.  If > 0, lftp will try only this number of
976              times to look up an address of each address family in dns:order.
977
978       file:charset (string)
979              local character set. It is set from current locale initially.
980
981       fish:charset (string)
982              the  character  set used by fish server in requests, replies and
983              file listings.  Default is empty which means the same as local.
984
985       fish:connect-program (string)
986              the program to use for connecting to remote  server.  It  should
987              support `-l' option for user name, `-p' for port number. Default
988              is `ssh -a -x'. You can set it to `rsh', for example.
989
990       fish:shell (string)
991              use specified shell on server side. Default is /bin/sh. On  some
992              systems,  /bin/sh  exits  when doing cd to a non-existent direc‐
993              tory. lftp can handle that but it has to reconnect.  Set  it  to
994              /bin/bash for such systems if bash is installed.
995
996       ftp:acct (string)
997              Send  this  string  in  ACCT  command after login. The result is
998              ignored.  The closure for this setting has format user@host.
999
1000       ftp:anon-pass (string)
1001              sets the password used for anonymous FTP access  authentication.
1002              Default is "lftp@".
1003
1004       ftp:anon-user (string)
1005              sets the user name used for anonymous FTP access authentication.
1006              Default is "anonymous".
1007
1008       ftp:auto-sync-mode (regex)
1009              if first server message matches this regex, turn  on  sync  mode
1010              for that host.
1011
1012       ftp:charset (string)
1013              the  character  set  used by FTP server in requests, replies and
1014              file listings.  Default is empty which means the same as  local.
1015              This setting is only used when the server does not support UTF8.
1016
1017       ftp:client (string)
1018              the  name  of FTP client to send with CLNT command, if supported
1019              by server.  If it is empty, then no CLNT command will be sent.
1020
1021       ftp:bind-data-socket (boolean)
1022              bind data socket to the interface of control connection (in pas‐
1023              sive  mode).   Default is true, exception is the loopback inter‐
1024              face.
1025
1026       ftp:fix-pasv-address (boolean)
1027              if true, lftp will try to correct address returned by server for
1028              PASV  command  in  case when server address is in public network
1029              and PASV returns an address from a private network. In this case
1030              lftp would substitute server address instead of the one returned
1031              by PASV command, port number would not be changed.   Default  is
1032              true.
1033
1034       ftp:fxp-passive-source (boolean)
1035              if  true,  lftp  will try to set up source FTP server in passive
1036              mode first, otherwise destination one. If first  attempt  fails,
1037              lftp  tries  to set them up the other way. If the other disposi‐
1038              tion fails too, lftp falls back to plain copy. See also ftp:use-
1039              fxp.
1040
1041       ftp:home (string)
1042              Initial directory. Default is empty string which means auto. Set
1043              this to `/' if you don't like the look of %2F in FTP  URLs.  The
1044              closure for this setting has format user@host.
1045
1046       ftp:ignore-pasv-address (boolean)
1047              If true, lftp uses control connection address instead of the one
1048              returned in PASV reply for data connection. This can  be  useful
1049              for broken NATs.  Default is false.
1050
1051       ftp:list-empty-ok (boolean)
1052              if  set  to false, empty lists from LIST command will be treated
1053              as incorrect, and another method (NLST) will be used.
1054
1055       ftp:list-options (string)
1056              sets options which are always appended to LIST command.  It  can
1057              be  useful to set this to `-a' if server does not show dot (hid‐
1058              den) files by default.  Default is empty.
1059
1060       ftp:nop-interval (seconds)
1061              delay between NOOP commands when downloading  tail  of  a  file.
1062              This  is  useful  for FTP servers which send "Transfer complete"
1063              message before flushing data transfer. In such cases  NOOP  com‐
1064              mands can prevent connection timeout.
1065
1066       ftp:passive-mode (boolean)
1067              sets  passive  FTP  mode. This can be useful if you are behind a
1068              firewall or a dumb masquerading router.  In  passive  mode  lftp
1069              uses  PASV command, not the PORT command which is used in active
1070              mode. In passive mode lftp itself makes the data  connection  to
1071              the  server; in active mode the server connects to lftp for data
1072              transfer. Passive mode is the default.
1073
1074       ftp:port-ipv4 (ipv4 address)
1075              specifies an IPv4 address to send with PORT command. Default  is
1076              empty  which  means  to send the address of local end of control
1077              connection.
1078
1079       ftp:port-range (from-to)
1080              allowed port range for  active  mode.   Format  is  min-max,  or
1081              `full' or `any' to indicate any port. Default is `full'.
1082
1083       ftp:prefer-epsv (boolean)
1084              use EPSV as preferred passive mode. Default is `false'.
1085
1086       ftp:proxy (URL)
1087              specifies  FTP proxy to use.  To disable proxy set this to empty
1088              string. Note that it is a FTP proxy which uses FTP protocol, not
1089              FTP  over HTTP. Default value is taken from environment variable
1090              ftp_proxy if it  starts  with  ``ftp://''.  If  your  FTP  proxy
1091              requires  authentication,  specify user name and password in the
1092              URL.  If ftp:proxy starts with http:// then hftp  protocol  (FTP
1093              over HTTP proxy) is used instead of FTP automatically.
1094
1095       ftp:proxy-auth-type (string)
1096              When  set  to ``joined'', lftp sends ``user@proxy_user@ftp.exam‐
1097              ple.org'' as user name to proxy, and ``password@proxy_password''
1098              as password.
1099
1100              When  set  to ``joined-acct'', lftp sends ``user@ftp.example.org
1101              proxy_user'' (with space) as user name to proxy. The site  pass‐
1102              word  is sent as usual and the proxy password is expected in the
1103              following ACCT command.
1104
1105              When set to ``open'', lftp first  sends  proxy  user  and  proxy
1106              password  and  then  ``OPEN ftp.example.org'' followed by ``USER
1107              user''.  The site password is then sent as usual.
1108
1109              When set to ``user'' (default), lftp first sends proxy user  and
1110              proxy  password  and then ``user@ftp.example.org'' as user name.
1111              The site password is then sent as usual.
1112
1113              When  set  to  ``proxy-user@host'',  lftp  first  sends   ``USER
1114              proxy_user@ftp.example.org'', then proxy password. The site user
1115              and password are then sent as usual.
1116
1117       ftp:rest-list (boolean)
1118              allow usage of REST command before LIST command. This  might  be
1119              useful  for  large  directories,  but  some FTP servers silently
1120              ignore REST before LIST.
1121
1122       ftp:rest-stor (boolean)
1123              if false, lftp will not try to use REST before STOR. This can be
1124              useful  for  some  buggy servers which corrupt (fill with zeros)
1125              the file if REST followed by STOR is used.
1126
1127       ftp:retry-530 (regex)
1128              Retry on server reply 530 for PASS command if text matches  this
1129              regular  expression.   This  setting should be useful to distin‐
1130              guish between overloaded server (temporary condition) and incor‐
1131              rect password (permanent condition).
1132
1133       ftp:retry-530-anonymous (regex)
1134              Additional   regular   expression   for  anonymous  login,  like
1135              ftp:retry-530.
1136
1137       ftp:site-group (string)
1138              Send this string in SITE GROUP command after login.  The  result
1139              is ignored.  The closure for this setting has format user@host.
1140
1141       ftp:skey-allow (boolean)
1142              allow  sending  skey/opie reply if server appears to support it.
1143              On by default.
1144
1145       ftp:skey-force (boolean)
1146              do not send plain text password over the network, use  skey/opie
1147              instead. If skey/opie is not available, assume failed login. Off
1148              by default.
1149
1150       ftp:ssl-allow (boolean)
1151              if true, try to negotiate SSL connection  with  FTP  server  for
1152              non-anonymous  access.  Default is true. This and other SSL set‐
1153              tings are only available if lftp was compiled  with  an  ssl/tls
1154              library.
1155
1156       ftp:ssl-data-use-keys (boolean)
1157              if  true,  lftp loads ssl:key-file for protected data connection
1158              too. When false, it does not, and the server can match data  and
1159              control connections by session ID.  Default is true.
1160
1161       ftp:ssl-force (boolean)
1162              if  true,  refuse to send password in clear when server does not
1163              support SSL.  Default is false.
1164
1165       ftp:ssl-protect-data (boolean)
1166              if true, request SSL connection for data transfers. This is cpu-
1167              intensive but provides privacy. Default is false.
1168
1169       ftp:ssl-protect-fxp (boolean)
1170              if  true,  request  SSL connection for data transfer between two
1171              FTP servers in FXP mode. CPSV or SSCN command will  be  used  in
1172              that  case.  If SSL connection fails for some reason, lftp would
1173              try unprotected FXP transfer unless ftp:ssl-force is set for any
1174              of the two servers. Default is false.
1175
1176       ftp:ssl-protect-list (boolean)
1177              if true, request SSL connection for file list transfers. Default
1178              is true.
1179
1180       ftp:ssl-use-ccc (boolean)
1181              if true, lftp would issue CCC command after logon, thus  disable
1182              ssl protection layer on control connection.
1183
1184       ftp:stat-interval (time interval)
1185              interval between STAT commands. Default is 1 second.
1186
1187       ftp:sync-mode (boolean)
1188              if  true,  lftp  will  send  one  command at a time and wait for
1189              response. This might be useful if you  are  using  a  buggy  FTP
1190              server  or router. When it is off, lftp sends a pack of commands
1191              and waits for responses - it speeds up operation when round trip
1192              time  is  significant.   Unfortunately it does not work with all
1193              FTP servers and some routers have troubles with it, so it is  on
1194              by default.
1195
1196       ftp:timezone (string)
1197              Assume  this timezone for time in listings returned by LIST com‐
1198              mand.  This setting can be GMT offset [+|-]HH[:MM[:SS]]  or  any
1199              valid       TZ       value      (e.g.      Europe/Moscow      or
1200              MSK-3MSD,M3.5.0,M10.5.0/3). The default is GMT.  Set  it  to  an
1201              empty  value  to  assume local timezone specified by environment
1202              variable TZ.
1203
1204       ftp:trust-feat (string)
1205              When true, assume that FEAT returned data are correct and  don't
1206              use common protocol extensions like SIZE, MDTM, REST if they are
1207              not listed.  Default is false.
1208
1209       ftp:use-abor (boolean)
1210              if false, lftp does not send ABOR command but closes  data  con‐
1211              nection immediately.
1212
1213       ftp:use-allo (boolean)
1214              when  true (default), lftp sends ALLO command before uploading a
1215              file.
1216
1217       ftp:use-feat (boolean)
1218              when  true  (default),  lftp  uses  FEAT  command  to  determine
1219              extended features of ftp server.
1220
1221       ftp:use-fxp (boolean)
1222              if  true,  lftp will try to set up direct connection between two
1223              ftp servers.
1224
1225       ftp:use-hftp (boolean)
1226              when ftp:proxy points to an http  proxy,  this  setting  selects
1227              hftp  method  (GET,  HEAD)  when  true,  and CONNECT method when
1228              false. Default is true.
1229
1230       ftp:use-ip-tos (boolean)
1231              when true, lftp uses IPTOS_LOWDELAY for control  connection  and
1232              IPTOS_THROUGHPUT for data connections.
1233
1234       ftp:lang (boolean)
1235              the  language  selected with LANG command, if supported as indi‐
1236              cated by FEAT response. Default  is  empty  which  means  server
1237              default.
1238
1239       ftp:use-mdtm (boolean)
1240              when  true  (default),  lftp uses MDTM command to determine file
1241              modification time.
1242
1243       ftp:use-mdtm-overloaded (boolean)
1244              when true, lftp uses two argument MDTM command to set file modi‐
1245              fication time on uploaded files. Default is false.
1246
1247       ftp:use-site-idle (boolean)
1248              when  true,  lftp  sends `SITE IDLE' command with net:idle argu‐
1249              ment. Default is false.
1250
1251       ftp:use-site-utime (boolean)
1252              when true, lftp sends 5-argument `SITE  UTIME'  command  to  set
1253              file modification time on uploaded files. Default is true.
1254
1255       ftp:use-site-utime2 (boolean)
1256              when  true,  lftp  sends  2-argument `SITE UTIME' command to set
1257              file modification time on uploaded files. Default is  true.   If
1258              5-argument  `SITE  UTIME' is also enabled, 2-argument command is
1259              tried first.
1260
1261       ftp:use-size (boolean)
1262              when true (default), lftp uses SIZE command  to  determine  file
1263              size.
1264
1265       ftp:use-stat (boolean)
1266              if  true,  lftp  sends STAT command in FXP mode transfer to know
1267              how much data has been transferred. See also  ftp:stat-interval.
1268              Default is true.
1269
1270       ftp:use-stat-for-list (boolean)
1271              when  true,  lftp  uses STAT instead of LIST command. By default
1272              `.' is used as STAT argument. Using STAT, lftp  avoids  creating
1273              data connection for directory listing. Some servers require spe‐
1274              cial options for STAT,  use  ftp:list-options  to  specify  them
1275              (e.g. -la).
1276
1277       ftp:use-telnet-iac (boolean)
1278              when  true  (default),  lftp uses TELNET IAC command and follows
1279              TELNET protocol as specified in RFC959. When false, it does  not
1280              follow TELNET protocol and thus does not double 255 (0xFF, 0377)
1281              character and does not prefix ABOR and STAT commands with TELNET
1282              IP+SYNCH signal.
1283
1284       ftp:use-tvfs (tri-boolean)
1285              When  set  to auto, usage of TVFS feature depends on FEAT server
1286              reply. Otherwise this setting tells whether use it  or  not.  In
1287              short,  if a server supports TVFS feature then it uses unix-like
1288              paths.
1289
1290       ftp:use-quit (boolean)
1291              if true, lftp sends QUIT before disconnecting from  ftp  server.
1292              Default is true.
1293
1294       ftp:verify-address (boolean)
1295              verify  that  data  connection comes from the network address of
1296              control connection peer. This can possibly prevent data  connec‐
1297              tion  spoofing which can lead to data corruption. Unfortunately,
1298              this can fail for  certain  ftp  servers  with  several  network
1299              interfaces,  when  they  do  not  set  outgoing  address on data
1300              socket, so it is disabled by default.
1301
1302       ftp:verify-port (boolean)
1303              verify that data connection has port 20 (ftp-data) on its remote
1304              end.   This  can  possibly  prevent  data connection spoofing by
1305              users of remote host. Unfortunately, too many windows  and  even
1306              unix  ftp  servers forget to set proper port on data connection,
1307              thus this check is off by default.
1308
1309       ftp:web-mode (boolean)
1310              disconnect after closing data connection. This can be useful for
1311              totally broken ftp servers. Default is false.
1312
1313       ftps:initial-prot (string)
1314              specifies  initial  PROT setting for FTPS connections. Should be
1315              one of: C, S, E, P, or  empty.  Default  is  empty  which  means
1316              unknown,  so that lftp will use PROT command unconditionally. If
1317              PROT command turns out to be unsupported, then Clear mode  would
1318              be assumed.
1319
1320       hftp:cache (boolean)
1321              allow server/proxy side caching for ftp-over-http protocol.
1322
1323       hftp:cache-control (string)
1324              specify corresponding HTTP request header.
1325
1326       hftp:proxy (URL)
1327              specifies HTTP proxy for FTP-over-HTTP protocol (hftp). The pro‐
1328              tocol hftp cannot work without a HTTP proxy, obviously.  Default
1329              value  is taken from environment variable ftp_proxy if it starts
1330              with   ``http://'',   otherwise   from   environment    variable
1331              http_proxy.   If your FTP proxy requires authentication, specify
1332              user name and password in the URL.
1333
1334       hftp:use-allprop (boolean)
1335              if true, lftp will send `<allprop/>' request body in  `PROPFIND'
1336              requests, otherwise it will send an empty request body.
1337
1338       hftp:use-authorization (boolean)
1339              if  set  to  off,  lftp will send password as part of URL to the
1340              proxy. This may be required  for  some  proxies  (e.g.  M-soft).
1341              Default is on, and lftp will send password as part of Authoriza‐
1342              tion header.
1343
1344       hftp:use-head (boolean)
1345              if set to off, lftp will try to use `GET' instead of `HEAD'  for
1346              hftp  protocol.  While this is slower, it may allow lftp to work
1347              with some proxies which don't  understand  or  mishandle  ``HEAD
1348              ftp://'' requests.
1349
1350       hftp:use-mkcol (boolean)
1351              if  set to off, lftp will try to use `PUT' instead of `MKCOL' to
1352              create directories with hftp protocol. Default is off.
1353
1354       hftp:use-propfind (boolean)
1355              if set to off, lftp will not try to use `PROPFIND' to get direc‐
1356              tory  contents with hftp protocol and use `GET' instead. Default
1357              is off.
1358
1359       hftp:use-type (boolean)
1360              If set to off, lftp won't try to append `;type=' to URLs  passed
1361              to  proxy.   Some  broken  proxies  don't  handle  it correctly.
1362              Default is on.
1363
1364       http:accept, http:accept-charset, http:accept-language (string)
1365              specify corresponding HTTP request headers.
1366
1367       http:authorization (string)
1368              the authorization to use by default, when no user is  specified.
1369              The format is ``user:password''. Default is empty which means no
1370              authorization.
1371
1372       http:cache (boolean)
1373              allow server/proxy side caching.
1374
1375       http:cache-control (string)
1376              specify corresponding HTTP request header.
1377
1378       http:cookie (string)
1379              send this cookie to server. A closure is useful here:
1380                   set cookie/www.somehost.com "param=value"
1381
1382       http:post-content-type (string)
1383              specifies value of Content-Type HTTP  request  header  for  POST
1384              method.  Default is ``application/x-www-form-urlencoded''.
1385
1386       http:proxy (URL)
1387              specifies  HTTP proxy. It is used when lftp works over HTTP pro‐
1388              tocol.   Default  value  is  taken  from  environment   variable
1389              http_proxy.  If your proxy requires authentication, specify user
1390              name and password in the URL.
1391
1392       http:put-method (PUT or POST)
1393              specifies which HTTP method to use on put.
1394
1395       http:put-content-type (string)
1396              specifies value of Content-Type  HTTP  request  header  for  PUT
1397              method.
1398
1399       http:referer (string)
1400              specifies  value for Referer HTTP request header. Single dot `.'
1401              expands to current directory URL. Default is `.'. Set  to  empty
1402              string to disable Referer header.
1403
1404       http:set-cookies (boolean)
1405              if  true,  lftp  modifies  http:cookie variables when Set-Cookie
1406              header is received.
1407
1408       http:use-allprop (boolean)
1409              if true, lftp will send `<allprop/>' request body in  `PROPFIND'
1410              requests, otherwise it will send an empty request body.
1411
1412       http:use-mkcol (boolean)
1413              if  set to off, lftp will try to use `PUT' instead of `MKCOL' to
1414              create directories with HTTP protocol. Default is on.
1415
1416       http:use-propfind (boolean)
1417              if set to off, lftp will not try to use `PROPFIND' to get direc‐
1418              tory  contents with HTTP protocol and use `GET' instead. Default
1419              is on.
1420
1421       http:user-agent (string)
1422              the string lftp sends in User-Agent header of HTTP request.
1423
1424       https:proxy (string)
1425              specifies https proxy. Default value is taken  from  environment
1426              variable https_proxy.
1427
1428       mirror:dereference (boolean)
1429              when  true,  mirror  will dereference symbolic links by default.
1430              You can override  it  by  --no-dereference  option.  Default  if
1431              false.
1432
1433       mirror:exclude-regex (regex)
1434              specifies  default  exclusion  pattern.  You  can override it by
1435              --include option.
1436
1437       mirror:include-regex (regex)
1438              specifies default inclusion pattern. It is used just after  mir‐
1439              ror:exclude-regex   is   applied.  It  is  never  used  if  mir‐
1440              ror:exclude-regex is empty.
1441
1442       mirror:no-empty-dirs (boolean)
1443              when  true,  mirror  doesn't  create  empty  directories   (like
1444              --no-empty-dirs option).
1445
1446       mirror:order (list of patterns)
1447              specifies  order  of file transfers. E.g. setting this to "*.sfv
1448              *.sum" makes mirror to transfer files matching *.sfv first, then
1449              ones  matching *.sum and then all other files. To process direc‐
1450              tories after other files, add "*/" to end of pattern list.
1451
1452       mirror:parallel-directories (boolean)
1453              if true, mirror will start processing of several directories  in
1454              parallel  when it is in parallel mode. Otherwise, it will trans‐
1455              fer files from a single directory before moving to other  direc‐
1456              tories.
1457
1458       mirror:parallel-transfer-count (number)
1459              specifies  number  of  parallel  transfers  mirror is allowed to
1460              start. Default is  1.   You  can  override  it  with  --parallel
1461              option.
1462
1463       mirror:set-permissions (boolean)
1464              When  set  to  off,  mirror won't try to copy file and directory
1465              permissions.  You can override it by --perms option. Default  is
1466              on.
1467
1468       mirror:skip-noaccess (boolean)
1469              when true, mirror does not try to download files which are obvi‐
1470              ously unaccessible by the permission mask. Defaule is false.
1471
1472       mirror:use-pget-n (number)
1473              specifies -n option for pget command used to transfer every sin‐
1474              gle file under mirror. Default is 1 which disables pget.
1475
1476       module:path (string)
1477              colon  separated list of directories to look for modules. Can be
1478              initialized by environment variable LFTP_MODULE_PATH. Default is
1479              `PKGLIBDIR/VERSION:PKGLIBDIR'.
1480
1481       net:connection-limit (number)
1482              maximum  number  of  concurrent  connections to the same site. 0
1483              means unlimited.
1484
1485       net:connection-takeover (boolean)
1486              if true, foreground connections have  priority  over  background
1487              ones  and can interrupt background transfers to complete a fore‐
1488              ground operation.
1489
1490       net:idle (time interval)
1491              disconnect from server after this idle time. Default is  3  min‐
1492              utes.
1493
1494       net:limit-rate (bytes per second)
1495              limit  transfer  rate on data connection. 0 means unlimited. You
1496              can specify two numbers separated by colon to limit download and
1497              upload rate separately.  Suffixes are supported, e.g. 100K means
1498              102400.
1499
1500       net:limit-max (bytes)
1501              limit accumulating of unused limit-rate. 0 means twice of limit-
1502              rate.
1503
1504       net:limit-total-rate (bytes per second)
1505              limit  transfer  rate  of all connections in sum. 0 means unlim‐
1506              ited. You can specify two numbers separated by  colon  to  limit
1507              download  and  upload  rate  separately.  Note that sockets have
1508              receive buffers on them, this can  lead  to  network  link  load
1509              higher  than  this rate limit just after transfer beginning. You
1510              can try to set net:socket-buffer to relatively  small  value  to
1511              avoid this.
1512
1513       net:limit-total-max (bytes)
1514              limit  accumulating of unused limit-total-rate. 0 means twice of
1515              limit-total-rate.
1516
1517       net:max-retries (number)
1518              the maximum number of sequential tries of an  operation  without
1519              success.  0 means unlimited. 1 means no retries.
1520
1521       net:no-proxy (string)
1522              contains  comma separated list of domains for which proxy should
1523              not  be  used.   Default  is  taken  from  environment  variable
1524              no_proxy.
1525
1526       net:persist-retries (number)
1527              ignore  this number of hard errors. Useful to login to buggy FTP
1528              servers which reply 5xx when there is too many users.
1529
1530       net:reconnect-interval-base (seconds)
1531              sets the base minimal time between reconnects.  Actual  interval
1532              depends   on  net:reconnect-interval-multiplier  and  number  of
1533              attempts to perform an operation.
1534
1535       net:reconnect-interval-max (seconds)
1536              sets maximum reconnect interval.  When  current  interval  after
1537              multiplication by net:reconnect-interval-multiplier reaches this
1538              value (or exceeds it), it is reset back to  net:reconnect-inter‐
1539              val-base.
1540
1541       net:reconnect-interval-multiplier (real number)
1542              sets  multiplier  by which base interval is multiplied each time
1543              new attempt to perform an operation  fails.  When  the  interval
1544              reaches  maximum,  it is reset to base value. See net:reconnect-
1545              interval-base and net:reconnect-interval-max.
1546
1547       net:socket-bind-ipv4 (ipv4 address)
1548              bind all IPv4 sockets to specified address. This can  be  useful
1549              to  select a specific network interface to use. Default is empty
1550              which means not to bind  IPv4  sockets,  operating  system  will
1551              choose an address automatically using routing table.
1552
1553       net:socket-bind-ipv6 (ipv6 address)
1554              the same for IPv6 sockets.
1555
1556       net:socket-buffer (bytes)
1557              use  given  size  for  SO_SNDBUF and SO_RCVBUF socket options. 0
1558              means system default.
1559
1560       net:socket-maxseg (bytes)
1561              use given size for TCP_MAXSEG socket option. Not  all  operating
1562              systems support this option, but Linux does.
1563
1564       net:timeout (time interval)
1565              sets the network protocol timeout.
1566
1567       pget:default-n (number)
1568              default number of chunks to split the file to in pget.
1569
1570       pget:save-status (time interval)
1571              save  pget transfer status this often. Set to `never' to disable
1572              saving of the status file.  The status is saved to a  file  with
1573              suffix .lftp-pget-status.
1574
1575       sftp:charset (string)
1576              the  character  set  used  by SFTP server in file names and file
1577              listings.  Default is empty which means the same as local.  This
1578              setting  is only used for SFTP protocol version prior to 4. Ver‐
1579              sion 4 and later always use UTF-8.
1580
1581       sftp:connect-program (string)
1582              the program to use for connecting to remote  server.  It  should
1583              support `-l' option for user name, `-p' for port number. Default
1584              is `ssh -a -x'. You can set it to `rsh', for example.
1585
1586       sftp:max-packets-in-flight (number)
1587              The maximum number of unreplied packets in flight. If round trip
1588              time   is  significant,  you  should  increase  this  and  size-
1589              read/size-write. Default is 16.
1590
1591       sftp:protocol-version (number)
1592              The protocol number to negotiate. Default is 4. The actual  pro‐
1593              tocol version used depends on server.
1594
1595       sftp:server-program (string)
1596              The  server  program  implementing SFTP protocol. If it does not
1597              contain a slash `/', it is considered a ssh2  subsystem  and  -s
1598              option  is  used  when  starting  connect-program.   Default  is
1599              `sftp'. You can use rsh as transport level protocol like this:
1600                   set sftp:connect-program rsh
1601                   set sftp:server-program /usr/libexec/openssh/sftp-server
1602              Similarly you can run SFTP over SSH1.
1603
1604       sftp:size-read (number)
1605              Block size for reading. Default is 0x8000.
1606
1607       sftp:size-write (number)
1608              Block size for writing. Default is 0x8000.
1609
1610       ssl:ca-file (path to file)
1611              use specified file as Certificate Authority certificate.
1612
1613       ssl:ca-path (path to directory)
1614              use specified directory  as  Certificate  Authority  certificate
1615              repository (OpenSSL only).
1616
1617       ssl:check-hostname (boolean)
1618              when  true,  lftp checks if the host name used to connect to the
1619              server corresponds to the host name in its certificate.
1620
1621       ssl:crl-file (path to file)
1622              use specified file as Certificate Revocation List certificate.
1623
1624       ssl:crl-path (path to directory)
1625              use specified directory as Certificate Revocation List  certifi‐
1626              cate repository (OpenSSL only).
1627
1628       ssl:key-file (path to file)
1629              use specified file as your private key.
1630
1631       ssl:cert-file (path to file)
1632              use specified file as your certificate.
1633
1634       ssl:use-sni (boolean)
1635              when true, use Server Name Indication (SNI) TLS extension.
1636
1637       ssl:verify-certificate (boolean)
1638              if  set to yes, then verify server's certificate to be signed by
1639              a known Certificate Authority and not be on Certificate  Revoca‐
1640              tion List.
1641
1642       ssl:priority (string)
1643              free  form priority string for GnuTLS. If built with OpenSSL the
1644              understood values are + or - followed by SSL3.0, TLS1.0,  TLS1.1
1645              or TLS1.2, separated by :. Example:
1646                   set ssl:priority "NORMAL:-SSL3.0:-TLS1.0:-TLS1.1:+TLS1.2"
1647
1648       torrent:ip (ipv4 address)
1649              IP  address  to send to the tracker. Specify it if you are using
1650              an HTTP proxy.
1651
1652       torrent:ipv6 (ipv6 address)
1653              IPv6 address to send to the tracker.  By  default,  first  found
1654              global unicast address is used.
1655
1656       torrent:max-peers (number)
1657              maximum  number  of  peers  for  a torrent. Least used peers are
1658              removed to maintain this limit.
1659
1660       torrent:port-range (from-to)
1661              port range to accept connections on. A single port  is  selected
1662              when a torrent starts.
1663
1664       torrent:retracker (URL)
1665              explicit retracker URL, e.g. `http://retracker.local/announce'.
1666
1667       torrent:seed-max-time (time interval)
1668              maximum  seed time. After this period of time a complete torrent
1669              shuts down independently of ratio. It can be set to infinity  if
1670              needed.
1671
1672       torrent:seed-min-peers (number)
1673              minimum  number  of peers when the torrent is complete. If there
1674              are less, new peers are actively searched for.
1675
1676       torrent:stop-on-ratio (real number)
1677              torrent stops when it's complete and ratio reached this number.
1678
1679       torrent:use-dht (boolean)
1680              when true, DHT is used.
1681
1682       xfer:clobber (boolean)
1683              if this setting is off, get commands will not overwrite existing
1684              files and generate an error instead.
1685
1686       xfer:destination-directory (path or URL to directory)
1687              This  setting is used as default -O option for get and mget com‐
1688              mands.  Default is empty, which means current directory  (no  -O
1689              option).
1690
1691       xfer:disk-full-fatal (boolean)
1692              when true, lftp aborts a transfer if it cannot write target file
1693              because of full disk or quota; when false, lftp waits  for  disk
1694              space to be freed.
1695
1696       xfer:eta-period (seconds)
1697              the  period  over  which  weighted average rate is calculated to
1698              produce ETA.
1699
1700       xfer:eta-terse (boolean)
1701              show terse ETA (only high order parts). Default is true.
1702
1703       xfer:log (boolean)
1704              when true, lftp logs transfers to a file from xfer:log-file set‐
1705              ting.
1706
1707       xfer:log-file (pathtofile)
1708              the file to log transfers to. Default is ~/.lftp/transfer_log.
1709
1710       xfer:make-backup (boolean)
1711              when  true,  lftp  renames pre-existing file adding ``~'' suffix
1712              instead of overwriting it.
1713
1714       xfer:max-redirections (number)
1715              maximum number of redirections. This can be useful for download‐
1716              ing over HTTP.  0 prohibits redirections.
1717
1718       xfer:rate-period (seconds)
1719              the  period over which weighted average rate is calculated to be
1720              shown.
1721
1722       xfer:verify (boolean)
1723              when true, verify-command is launched after successful  transfer
1724              to  validate  file  integrity.  Zero  exit  code of that command
1725              should indicate correctness of the file.
1726
1727       xfer:verify-command (string)
1728              the command to validate file integrity. The only argument is the
1729              path to the file.
1730
1731       xfer:auto-rename(boolean)
1732              suggested  filenames  provided  by  the  server are used if user
1733              explicitly  sets  this  option to ’on’. As this could  be  secu‐
1734              rity risk, default is off.
1735
1736
1737       The  name of a variable can be abbreviated unless it becomes ambiguous.
1738       The prefix before `:' can be omitted too. You can set one variable sev‐
1739       eral  times  for  different closures, and thus you can get a particular
1740       settings for particular state. The closure is  to  be  specified  after
1741       variable name separated with slash `/'.
1742
1743       The  closure  for `dns:', `net:', `ftp:', `http:', `hftp:' domain vari‐
1744       ables is currently just the host name as you specify it in  the  `open'
1745       command  (with  some  exceptions  where  closure  is  meaningless, e.g.
1746       dns:cache-size).  For some `cmd:' domain variables the closure is  cur‐
1747       rent  URL  without path.  For other variables it is not currently used.
1748       See examples in the sample lftp.conf.
1749
1750       Certain commands and settings take a time interval  parameter.  It  has
1751       the  format Nx[Nx...], where N is time amount (floating point) and x is
1752       time unit: d - days, h - hours, m - minutes, s - seconds. Default  unit
1753       is  second.  E.g.  5h30m or 5.5h.  Also the interval can be `infinity',
1754       `inf', `never', `forever' - it means  infinite  interval.  E.g.  `sleep
1755       forever' or `set dns:cache-expire never'.
1756
1757       Boolean  settings  can be one of (true, on, yes, 1, +) for a True value
1758       or one of (false, off, no, 0, -) for a False value.
1759
1760       Tri-boolean settings have either a boolean value or `auto'.
1761
1762       Integer settings can have a suffix: k - kibi, m - mebi, g - gigi,  etc.
1763       They can also have a prefix: 0 - octal, 0x - hexadecimal.
1764
1765
1766   FTP asynchronous mode (pipelining)
1767       Lftp  can  speed  up FTP operations by sending several commands at once
1768       and then checking all the responses. See ftp:sync-mode variable.  Some‐
1769       times this does not work, thus synchronous mode is the default. You can
1770       try to turn synchronous mode off and see if it works  for  you.  It  is
1771       known that some network software dealing with address translation works
1772       incorrectly in the case of several FTP commands in one network packet.
1773
1774       RFC959 says: ``The user-process sending another command before the com‐
1775       pletion  reply  would  be in violation of protocol; but server-FTP pro‐
1776       cesses should queue any commands that arrive while a preceding  command
1777       is  in  progress''.  Also, RFC1123 says: ``Implementers MUST NOT assume
1778       any correspondence between READ boundaries on  the  control  connection
1779       and  the  Telnet  EOL sequences (CR LF).'' and ``a single READ from the
1780       control connection may include more than one FTP command''.
1781
1782       So it must be safe to send several commands at once,  which  speeds  up
1783       operation  a  lot  and  seems  to  work with all Unix and VMS based ftp
1784       servers. Unfortunately, windows based servers often cannot handle  sev‐
1785       eral commands in one packet, and so cannot some broken routers.
1786
1787

OPTIONS

1789       -d     Switch on debugging mode.
1790
1791       -e commands
1792              Execute given commands and don't exit.
1793
1794       -p port
1795              Use the given port to connect.
1796
1797       -u user[,pass]
1798              Use  the  given  username  and  password to connect. Remember to
1799              quote the password properly in the shell.  Also note that it  is
1800              not secure to specify the password on command line, use ~/.netrc
1801              file.  Alternatively you can use ssh-based protocols with autho‐
1802              rized keys, so you don't have to enter a password.
1803
1804       -f script_file
1805              Execute commands in the file and exit.  This option must be used
1806              alone without other arguments.
1807
1808       -c commands
1809              Execute the given commands and exit. Commands can  be  separated
1810              with  a  semicolon, `&&' or `||'. Remember to quote the commands
1811              argument properly in the shell.  This option must be used  alone
1812              without other arguments.
1813
1814

ENVIRONMENT VARIABLES

1816       The following environment variables are processed by lftp:
1817
1818       HOME   Used for (local) tilde (`~') expansion
1819
1820       SHELL  Used by the ! command to determine the shell to run.
1821
1822       PAGER  This  should  be the name of the pager to use.  It's used by the
1823              more and zmore commands.
1824
1825       http_proxy, https_proxy
1826              Used to set initial http:proxy, hftp:proxy and https:proxy vari‐
1827              ables.
1828
1829       ftp_proxy
1830              Used to set initial ftp:proxy or hftp:proxy variables, depending
1831              on URL protocol used in this environment variable.
1832
1833       no_proxy
1834              Used to set initial net:no-proxy variable.
1835
1836       LFTP_MODULE_PATH
1837              Used to set initial module:path variable.
1838
1839       LFTP_HOME
1840              Used to locate the directory that stores user-specific  configu‐
1841              ration files.  If unset, ~/.lftp will be used.
1842
1843       LS_COLORS
1844              used to set initial color:dir-colors variable.
1845
1846       XDG_CONFIG_DIR, XDG_DATA_DIR, XDG_CACHE_DIR
1847              Used  to  locate  the  directories  for user-specific files when
1848              ~/.lftp (or $LFTP_HOME directory) does not exist.  Defaults  are
1849              ~/.config,  ~/.local/share and ~/.cache respectively. The suffix
1850              /lftp is appended to make the full path to the directories.
1851
1852

FILES

1854       /etc/lftp.conf
1855              system-wide   startup   file.   Actual   location   depends   on
1856              --sysconfdir  configure  option. It is /etc when prefix is /usr,
1857              /usr/local/etc by default.
1858
1859
1860       ~/.lftp/rc, ~/.lftprc
1861              These files are executed on lftp startup after /etc/lftp.conf.
1862
1863       ~/.lftp/log
1864              The file things are logged to when lftp  moves  into  the  back‐
1865              ground in nohup mode.
1866
1867       ~/.lftp/transfer_log
1868              The file transfers are logged to when xfer:log setting is set to
1869              `yes'.  The location can be changed by xfer:log-file setting.
1870
1871       ~/.lftp/bookmarks
1872              The file is used to store lftp's bookmarks.   See  the  bookmark
1873              command.
1874
1875       ~/.lftp/cwd_history
1876              The file is used to store last working directories for each site
1877              visited.
1878
1879       ~/.lftp/bg/
1880              The directory is used to store named  sockets  for  backgrounded
1881              lftp processes.
1882
1883       ~/.lftp/DHT/"
1884              The  directory  is used to store DHT id and nodes cache for IPv4
1885              and IPv6.  File name suffix is the host name.
1886
1887       ~/.netrc
1888              The file is consulted to get default login and password  to  FTP
1889              server.   Passwords  are  also searched here if an URL with user
1890              name but with no password is used.
1891
1892

SEE ALSO

1894       ftpd(8), ftp(1)
1895       RFC854 (telnet), RFC959 (ftp),  RFC1123,  RFC1945  (http/1.0),  RFC2052
1896       (SRV  RR),  RFC2228  (ftp  security  extensions),  RFC2389  (ftp FEAT),
1897       RFC2428  (ftp/ipv6),  RFC2518  (WebDAV),  RFC2616  (http/1.1),  RFC2617
1898       (http/1.1  authentication), RFC2640 (ftp i18n), RFC4217 (ftp over ssl),
1899       BEP0003 (BitTorrent Protocol), BEP0005 (DHT  Protocol),  BEP0006  (Fast
1900       Extension),  BEP0007  (IPv6  Tracker Extension), BEP0009 (Extension for
1901       Peers to Send Metadata Files), BEP0010  (Extension  Protocol),  BEP0012
1902       (Multitracker  Metadata  Extension),  BEP0023  (Tracker Returns Compact
1903       Peer Lists), BEP0032 (DHT Extensions for IPv6).
1904       http://www.ietf.org/internet-drafts/draft-ietf-ftpext-mlst-16.txt (ftp
1905       extensions over RFC959),
1906       http://www.ietf.org/internet-drafts/draft-ietf-secsh-filexfer-10.txt
1907       (sftp).
1908       http://wiki.theory.org/BitTorrentSpecification
1909       http://www.bittornado.com/docs/multitracker-spec.txt
1910       http://www.rasterbar.com/products/libtorrent/dht_sec.html (DHT security
1911       extension)
1912       http://xbtt.sourceforge.net/udp_tracker_protocol.html (UDP tracker)
1913
1914

AUTHOR

1916       Alexander V. Lukyanov
1917       lav@yars.free.net
1918
1919

ACKNOWLEDGMENTS

1921       This  manual  page  was originally written by Christoph Lameter <clame‐
1922       ter@debian.org>, for the Debian GNU/Linux system. The page was improved
1923       and  updated  later by Nicolas Lichtmaier <nick@Feedback.com.ar>, James
1924       Troup   <J.J.Troup@comp.brad.ac.uk>   and   Alexander    V.    Lukyanov
1925       <lav@yars.free.net>.
1926
1927
1928
1929                                  12 Apr 2013                          lftp(1)
Impressum