1.\" $OpenBSD: ftp.1,v 1.124 2022/09/15 12:47:10 millert Exp $ 2.\" $NetBSD: ftp.1,v 1.22 1997/08/18 10:20:22 lukem Exp $ 3.\" 4.\" Copyright (c) 1985, 1989, 1990, 1993 5.\" The Regents of the University of California. All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. Neither the name of the University nor the names of its contributors 16.\" may be used to endorse or promote products derived from this software 17.\" without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94 32.\" 33.Dd $Mdocdate: September 15 2022 $ 34.Dt FTP 1 35.Os 36.Sh NAME 37.Nm ftp 38.Nd Internet file transfer program 39.Sh SYNOPSIS 40.Nm ftp 41.Op Fl 46AadEegiMmnptVv 42.Op Fl D Ar title 43.Op Fl k Ar seconds 44.Op Fl P Ar port 45.Op Fl r Ar seconds 46.Op Fl s Ar sourceaddr 47.Op Ar host Op Ar port 48.Nm ftp 49.Op Fl C 50.Op Fl N Ar name 51.Op Fl o Ar output 52.Op Fl s Ar sourceaddr 53.Sm off 54.Pf ftp:// Op Ar user : password No @ 55.Ar host Op : Ar port 56.No / Ar file Op / 57.Sm on 58.Ar ... 59.Nm ftp 60.Op Fl CTu 61.Op Fl c Ar cookie 62.Op Fl N Ar name 63.Op Fl o Ar output 64.Op Fl S Ar ssl_options 65.Op Fl s Ar sourceaddr 66.Op Fl U Ar useragent 67.Op Fl w Ar seconds 68.Sm off 69.Pf http Oo s Oc :// 70.Op Ar user : password No @ 71.Ar host Op : Ar port 72.No / Ar file 73.Sm on 74.Ar ... 75.Nm ftp 76.Op Fl C 77.Op Fl N Ar name 78.Op Fl o Ar output 79.Op Fl s Ar sourceaddr 80.Pf file: Ar 81.Nm ftp 82.Op Fl C 83.Op Fl N Ar name 84.Op Fl o Ar output 85.Op Fl s Ar sourceaddr 86.Ar host : Ns / Ns Ar file Ns Op / 87.Ar ... 88.Sh DESCRIPTION 89.Nm 90is the user interface to the Internet standard File Transfer 91Protocol (FTP). 92The program allows a user to transfer files to and from a 93remote network site. 94.Pp 95The latter four usage formats will fetch a file using either the 96FTP, HTTP, or HTTPS protocols into the current directory. 97This is ideal for scripts. 98Refer to 99.Sx AUTO-FETCHING FILES 100below for more information. 101.Pp 102The options are as follows: 103.Bl -tag -width Ds 104.It Fl 4 105Forces 106.Nm 107to use IPv4 addresses only. 108.It Fl 6 109Forces 110.Nm 111to use IPv6 addresses only. 112.It Fl A 113Force active mode FTP. 114By default, 115.Nm 116will try to use passive mode FTP and fall back to active mode 117if passive is not supported by the server. 118This option causes 119.Nm 120to always use an active connection. 121It is only useful for connecting 122to very old servers that do not implement passive mode properly. 123.It Fl a 124Causes 125.Nm 126to bypass the normal login procedure and use an anonymous login instead. 127.It Fl C 128Continue a previously interrupted file transfer. 129.Nm 130will continue transferring from an offset equal to the length of 131.Ar file . 132.Pp 133Resuming HTTP(S) transfers are only supported 134if the remote server supports the 135.Dq Range 136header. 137.It Fl c Ar cookie 138Load a Netscape-like cookiejar file 139for HTTP and HTTPS transfers. 140With this option relevant cookies from the jar are sent with each HTTP(S) 141request. 142Setting the 143.Ev http_cookies 144environment variable has the same effect. 145If both the 146.Ev http_cookies 147environment variable is set and the 148.Fl c 149argument is given, the latter takes precedence. 150.It Fl D Ar title 151Specify a short 152.Ar title 153for the start of the progress bar. 154.It Fl d 155Enables debugging. 156.It Fl E 157Disables EPSV/EPRT command on IPv4 connections. 158.It Fl e 159Disables command line editing. 160Useful for Emacs ange-ftp. 161.It Fl g 162Disables file name globbing. 163.It Fl i 164Turns off interactive prompting during 165multiple file transfers. 166.It Fl k Ar seconds 167When greater than zero, 168sends a byte after each 169.Ar seconds 170period over the control connection during long transfers, 171so that incorrectly configured network equipment won't 172aggressively drop it. 173The FTP protocol supports a 174.Dv NOOP 175command that can be used for that purpose. 176This assumes the FTP server can deal with extra commands coming over 177the control connection during a transfer. 178Well-behaved servers queue those commands, and process them after the 179transfer. 180By default, 181.Nm 182will send a byte every 60 seconds. 183.It Fl M 184Causes 185.Nm 186to never display the progress meter in cases where it would do 187so by default. 188.It Fl m 189Causes 190.Nm 191to always display the progress meter in cases where it would not do 192so by default. 193.It Fl N Ar name 194Use this alternative name instead of 195.Nm 196in some error reports. 197.It Fl n 198Restrains 199.Nm 200from attempting 201.Dq auto-login 202upon initial connection. 203If auto-login is enabled, 204.Nm 205will check the 206.Pa .netrc 207file (see below) in the user's home directory for an entry describing 208an account on the remote machine. 209If no entry exists, 210.Nm 211will prompt for the remote machine login name (default is the user 212identity on the local machine) and, if necessary, prompt for a password 213and an account with which to log in. 214.It Fl o Ar output 215When fetching a single file or URL, save the contents in 216.Ar output . 217To make the contents go to stdout, 218use 219.Sq - 220for 221.Ar output . 222.It Fl P Ar port 223Sets the port number to 224.Ar port . 225.It Fl p 226Enable passive mode operation for use behind connection filtering firewalls. 227This option has been deprecated as 228.Nm 229now tries to use passive mode by default, falling back to active mode 230if the server does not support passive connections. 231.It Fl r Ar seconds 232Retry to connect if failed, pausing for number of 233.Ar seconds . 234.It Fl S Ar ssl_options 235SSL/TLS options to use with HTTPS transfers. 236The following settings are available: 237.Bl -tag -width Ds 238.It Cm cafile Ns = Ns Ar /path/to/cert.pem 239PEM encoded file containing CA certificates used for certificate 240validation. 241.It Cm capath Ns = Ns Ar /path/to/certs/ 242Directory containing PEM encoded CA certificates used for certificate 243validation. 244Such a directory can be prepared using the c_rehash script distributed with 245OpenSSL. 246.It Cm ciphers Ns = Ns Ar cipher_list 247Specify the list of ciphers that will be used by 248.Nm . 249See the 250.Xr openssl 1 251.Cm ciphers 252subcommand. 253.It Cm depth Ns = Ns Ar max_depth 254Maximum depth of the certificate chain allowed when performing 255validation. 256.It Cm do 257Perform server certificate validation. 258.It Cm dont 259Don't perform server certificate validation. 260.It Cm muststaple 261Require the server to present a valid OCSP stapling in the TLS handshake. 262.It Cm noverifytime 263Disable validation of certificate times and OCSP validation. 264.It Cm protocols Ns = Ns Ar protocol_list 265Specify the TLS protocols that will be supported by 266.Nm 267(see 268.Xr tls_config_parse_protocols 3 269for details). 270.It Cm session Ns = Ns Ar /path/to/session 271Specify a file to use for TLS session data. 272If this file has a non-zero length, the session data will be read from this file 273and the client will attempt to resume the TLS session with the server. 274Upon completion of a successful TLS handshake this file will be updated 275with new session data, if available. 276This file will be created if it does not already exist. 277.El 278.Pp 279By default, server certificate validation is performed, and if it fails 280.Nm 281will abort. 282If no 283.Cm cafile 284or 285.Cm capath 286setting is provided, 287.Pa /etc/ssl/cert.pem 288will be used. 289.It Fl s Ar sourceaddr 290Set the source address for connections, which is useful on machines 291with multiple interfaces. 292.It Fl T 293Send an 294.Dq If-Modified-Since 295header to the remote to determine if the remote file's timestamp 296has changed. 297.It Fl t 298Enables packet tracing. 299.It Fl U Ar useragent 300Set 301.Ar useragent 302as the User-Agent for HTTP(S) URL requests. 303If not specified, the default User-Agent is 304.Dq OpenBSD ftp . 305.It Fl u 306Disable setting the local file's timestamps based 307on the 308.Dq Last-Modified 309header. 310By default the local file's timestamps are set to match those 311from the remote. 312.It Fl V 313Disable verbose mode, overriding the default of enabled when input 314is from a terminal. 315.It Fl v 316Enable verbose mode. 317This is the default if input is from a terminal. 318Forces 319.Nm 320to show all responses from the remote server, as well 321as report on data transfer statistics. 322.It Fl w Ar seconds 323Wait for 324.Ar seconds 325for the remote server to connect before giving up. 326.El 327.Pp 328The host with which 329.Nm 330is to communicate may be specified on the command line. 331If this is done, 332.Nm 333will immediately attempt to establish a connection to an 334FTP server on that host; otherwise, 335.Nm 336will enter its command interpreter and await instructions 337from the user. 338When 339.Nm 340is awaiting commands, the prompt 341.Dq ftp\*(Gt 342is provided to the user. 343The following commands are recognized 344by 345.Nm : 346.Bl -tag -width Ds 347.It Ic \&! Oo Ar command 348.Op Ar arg ... 349.Oc 350Invoke an interactive shell on the local machine. 351If there are arguments, the first is taken to be a command to execute 352directly, with the rest of the arguments as its arguments. 353.It Ic \&$ Ar macro-name Op Ar arg ... 354Execute the macro 355.Ar macro-name 356that was defined with the 357.Ic macdef 358command. 359Arguments are passed to the macro unglobbed. 360.It Ic \&? Op Ar command 361A synonym for 362.Ic help . 363.It Ic account Op Ar password 364Supply a supplemental password required by a remote system for access 365to resources once a login has been successfully completed. 366If no argument is included, the user will be prompted for an account 367password in a non-echoing input mode. 368.It Ic append Ar local-file Op Ar remote-file 369Append a local file to a file on the remote machine. 370If 371.Ar remote-file 372is left unspecified, the local file name is used in naming the 373remote file after being altered by any 374.Ic ntrans 375or 376.Ic nmap 377setting. 378File transfer uses the current settings for 379.Ic type , 380.Ic format , 381.Ic mode , 382and 383.Ic structure . 384.It Ic ascii 385Set the file transfer 386.Ic type 387to network ASCII. 388.It Ic bell Op Ic on | off 389Arrange that a bell be sounded after each file transfer 390command is completed. 391.It Ic binary 392Set the file transfer 393.Ic type 394to support binary image transfer. 395This is the default type. 396.It Ic bye 397Terminate the FTP session with the remote server and exit 398.Nm . 399An end-of-file will also terminate the session and exit. 400.It Ic case Op Ic on | off 401Toggle remote computer file name case mapping during 402.Ic mget 403commands. 404When 405.Ic case 406is on (default is off), remote computer file names with all letters in 407upper case are written in the local directory with the letters mapped 408to lower case. 409.It Ic cd Ar remote-directory 410Change the working directory on the remote machine 411to 412.Ar remote-directory . 413.It Ic cdup 414Change the remote machine working directory to the parent of the 415current remote machine working directory. 416.It Ic chmod Ar mode file 417Change the permission modes of 418.Ar file 419on the remote 420system to 421.Ar mode . 422.It Ic close 423Terminate the FTP session with the remote server and 424return to the command interpreter. 425Any defined macros are erased. 426.It Ic cr Op Ic on | off 427Toggle carriage return stripping during 428ASCII type file retrieval. 429Records are denoted by a carriage return/linefeed sequence 430during ASCII type file transfer. 431When 432.Ic cr 433is on (the default), carriage returns are stripped from this 434sequence to conform with the 435.Ux 436single linefeed record delimiter. 437Records on non-UNIX 438remote systems may contain single linefeeds; 439when an ASCII type transfer is made, these linefeeds may be 440distinguished from a record delimiter only when 441.Ic cr 442is off. 443.It Ic debug Oo Ic on | off | 444.Ar debuglevel 445.Oc 446Toggle debugging mode. 447If an optional 448.Ar debuglevel 449is specified, it is used to set the debugging level. 450When debugging is on, 451.Nm 452prints each command sent to the remote machine, 453preceded by the string 454.Ql --\*(Gt . 455.It Ic delete Ar remote-file 456Delete the file 457.Ar remote-file 458on the remote machine. 459.It Ic dir Op Ar remote-directory Op Ar local-file 460A synonym for 461.Ic ls . 462.It Ic disconnect 463A synonym for 464.Ic close . 465.It Ic edit Op Ic on | off 466Toggle command line editing, and context sensitive command and file 467completion. 468This is automatically enabled if input is from a terminal, and 469disabled otherwise. 470.It Ic epsv4 Op Ic on | off 471Toggle use of EPSV/EPRT command on IPv4 connection. 472.It Ic exit 473A synonym for 474.Ic bye . 475.It Ic form Ar format 476Set the file transfer 477.Ic form 478to 479.Ar format . 480The default format is 481.Dq file . 482.It Ic ftp Ar host Op Ar port 483A synonym for 484.Ic open . 485.It Ic gate Oo Ic on | off | 486.Ar host Op Ar port 487.Oc 488Toggle gate-ftp mode. 489This will not be permitted if the gate-ftp server hasn't been set 490(either explicitly by the user, or from the 491.Ev FTPSERVER 492environment variable). 493If 494.Ar host 495is given, 496then gate-ftp mode will be enabled, and the gate-ftp server will be set to 497.Ar host . 498If 499.Ar port 500is also given, that will be used as the port to connect to on the 501gate-ftp server. 502.It Ic get Ar remote-file Op Ar local-file 503Retrieve the 504.Ar remote-file 505and store it on the local machine. 506If the local 507file name is not specified, it is given the same 508name it has on the remote machine, subject to 509alteration by the current 510.Ic case , 511.Ic ntrans , 512and 513.Ic nmap 514settings. 515The current settings for 516.Ic type , 517.Ic form , 518.Ic mode , 519and 520.Ic structure 521are used while transferring the file. 522.It Ic glob Op Ic on | off 523Toggle filename expansion for 524.Ic mdelete , 525.Ic mget 526and 527.Ic mput . 528If globbing is turned off with 529.Ic glob , 530the file name arguments 531are taken literally and not expanded. 532Globbing for 533.Ic mput 534is done as in 535.Xr csh 1 . 536For 537.Ic mdelete 538and 539.Ic mget , 540each remote file name is expanded 541separately on the remote machine and the lists are not merged. 542Expansion of a directory name is likely to be 543different from expansion of the name of an ordinary file: 544the exact result depends on the foreign operating system and FTP server, 545and can be previewed by doing 546.Dq mls remote-files - . 547Note: 548.Ic mget 549and 550.Ic mput 551are not meant to transfer 552entire directory subtrees of files. 553That can be done by 554transferring a 555.Xr tar 1 556archive of the subtree (in binary mode). 557.It Ic hash Oo Ic on | off | 558.Ar size 559.Oc 560Toggle hash mark 561.Pq Ql # 562printing for each data block transferred. 563The size of a data block defaults to 1024 bytes. 564This can be changed by specifying 565.Ar size 566in bytes. 567.It Ic help Op Ar command 568Print an informative message about the meaning of 569.Ar command . 570If no argument is given, 571.Nm 572prints a list of the known commands. 573.It Ic idle Op Ar seconds 574Set the inactivity timer on the remote server to 575.Ar seconds 576seconds. 577If 578.Ar seconds 579is omitted, the current inactivity timer is printed. 580.It Ic lcd Op Ar local-directory 581Change the working directory on the local machine. 582If 583no 584.Ar local-directory 585is specified, the user's home directory is used. 586.It Ic less Ar file 587A synonym for 588.Ic page . 589.It Ic lpwd 590Print the working directory on the local machine. 591.It Ic ls Op Ar remote-directory Op Ar local-file 592Print a listing of the contents of a directory on the remote machine. 593The listing includes any system-dependent information that the server 594chooses to include; for example, most 595.Ux 596systems will produce output from the command 597.Ql ls -l . 598If 599.Ar remote-directory 600is left unspecified, the current working directory is used. 601If interactive prompting is on, 602.Nm 603will prompt the user to verify that the last argument is indeed the 604target local file for receiving 605.Ic ls 606output. 607If no local file is specified, or if 608.Ar local-file 609is 610.Sq - , 611the output is sent to the terminal. 612.It Ic macdef Ar macro-name 613Define a macro. 614Subsequent lines are stored as the macro 615.Ar macro-name ; 616a null line (consecutive newline characters 617in a file or 618carriage returns from the terminal) terminates macro input mode. 619There is a limit of 16 macros and 4096 total characters in all 620defined macros. 621Macro names can be a maximum of 8 characters. 622Macros are only applicable to the current session they are 623defined in (or if defined outside a session, to the session 624invoked with the next 625.Ic open 626command), and remain defined until a 627.Ic close 628command is executed. 629To invoke a macro, 630use the 631.Ic $ 632command (see above). 633.Pp 634The macro processor interprets 635.Ql $ 636and 637.Ql \e 638as special characters. 639A 640.Ql $ 641followed by a number (or numbers) is replaced by the 642corresponding argument on the macro invocation command line. 643A 644.Ql $ 645followed by an 646.Sq i 647tells the macro processor that the 648executing macro is to be looped. 649On the first pass 650.Ql $i 651is 652replaced by the first argument on the macro invocation command line, 653on the second pass it is replaced by the second argument, and so on. 654A 655.Ql \e 656followed by any character is replaced by that character. 657Use the 658.Ql \e 659to prevent special treatment of the 660.Ql $ . 661.It Ic mdelete Op Ar remote-files 662Delete the 663.Ar remote-files 664on the remote machine. 665.It Ic mdir Ar remote-files local-file 666A synonym for 667.Ic mls . 668.It Xo Ic mget 669.Op Fl cnr 670.Op Fl d Ar depth 671.Ar remote-files 672.Xc 673Expand the 674.Ar remote-files 675on the remote machine 676and do a 677.Ic get 678for each file name thus produced. 679See 680.Ic glob 681for details on the filename expansion. 682Resulting file names will then be processed according to 683.Ic case , 684.Ic ntrans , 685and 686.Ic nmap 687settings. 688Files are transferred into the local working directory, 689which can be changed with 690.Ql lcd directory ; 691new local directories can be created with 692.Ql "\&! mkdir directory" . 693.Pp 694The options are as follows: 695.Bl -tag -width Ds 696.It Fl c 697Use 698.Ic reget 699instead of 700.Ic get . 701.It Fl d Ar depth 702Specify the maximum recursion level 703.Ar depth . 704The default is 0, which means unlimited. 705.It Fl n 706Use 707.Ic newer 708instead of 709.Ic get . 710.It Fl r 711Recursively descend the directory tree, transferring all files and 712directories. 713.El 714.It Ic mkdir Ar directory-name 715Make a directory on the remote machine. 716.It Ic mls Ar remote-files local-file 717Like 718.Ic ls , 719except multiple remote files may be specified, 720and the 721.Ar local-file 722must be specified. 723If interactive prompting is on, 724.Nm 725will prompt the user to verify that the last argument is indeed the 726target local file for receiving 727.Ic mls 728output. 729.It Ic mode Op Ar mode-name 730Set the file transfer 731.Ic mode 732to 733.Ar mode-name . 734The default mode is 735.Dq stream 736mode. 737.It Ic modtime Ar file 738Show the last modification time of 739.Ar file 740on the remote machine. 741.It Ic more Ar file 742A synonym for 743.Ic page . 744.It Xo Ic mput 745.Op Fl cr 746.Op Fl d Ar depth 747.Ar local-files 748.Xc 749Expand wild cards in the list of local files given as arguments 750and do a 751.Ic put 752for each file in the resulting list. 753See 754.Ic glob 755for details of filename expansion. 756Resulting file names will then be processed according to 757.Ic ntrans 758and 759.Ic nmap 760settings. 761.Pp 762The options are as follows: 763.Bl -tag -width Ds 764.It Fl c 765Use 766.Ic reput 767instead of 768.Ic put . 769.It Fl d Ar depth 770Specify the maximum recursion level 771.Ar depth . 772The default is 0, which means unlimited. 773.It Fl r 774Recursively descend the directory tree, transferring all files and 775directories. 776.El 777.It Xo Ic msend 778.Op Fl c 779.Ar local-files 780.Xc 781A synonym for 782.Ic mput . 783.It Ic newer Ar remote-file Op Ar local-file 784Get the file only if the modification time of the remote file is more 785recent than the file on the current system. 786If the file does not 787exist on the current system, the remote file is considered 788.Ic newer . 789Otherwise, this command is identical to 790.Ar get . 791.It Ic nlist Op Ar remote-directory Op Ar local-file 792Print a list of the files in a 793directory on the remote machine. 794If 795.Ar remote-directory 796is left unspecified, the current working directory is used. 797If interactive prompting is on, 798.Nm 799will prompt the user to verify that the last argument is indeed the 800target local file for receiving 801.Ic nlist 802output. 803If no local file is specified, or if 804.Ar local-file 805is 806.Sq - , 807the output is sent to the terminal. 808Note that on some servers, the 809.Ic nlist 810command will only return information on normal files (not directories 811or special files). 812.It Ic nmap Op Ar inpattern outpattern 813Set or unset the filename mapping mechanism. 814If no arguments are specified, the filename mapping mechanism is unset. 815If arguments are specified, remote filenames are mapped during 816.Ic mput 817commands and 818.Ic put 819commands issued without a specified remote target filename. 820If arguments are specified, local filenames are mapped during 821.Ic mget 822commands and 823.Ic get 824commands issued without a specified local target filename. 825This command is useful when connecting to a non-UNIX remote computer 826with different file naming conventions or practices. 827.Pp 828The mapping follows the pattern set by 829.Ar inpattern 830and 831.Ar outpattern . 832.Ar inpattern 833is a template for incoming filenames (which may have already been 834processed according to the 835.Ic ntrans 836and 837.Ic case 838settings). 839Variable templating is accomplished by including the 840sequences 841.Ql $1 , 842.Ql $2 , 843\&..., 844.Ql $9 845in 846.Ar inpattern . 847Use 848.Ql \e 849to prevent this special treatment of the 850.Ql $ 851character. 852All other characters are treated literally, and are used to determine the 853.Ic nmap 854.Ar inpattern 855variable values. 856.Pp 857For example, given 858.Ar inpattern 859$1.$2 and the remote file name "mydata.data", $1 would have the value 860"mydata", and $2 would have the value "data". 861The 862.Ar outpattern 863determines the resulting mapped filename. 864The sequences 865.Ql $1 , 866.Ql $2 , 867\&..., 868.Ql $9 869are replaced by any value resulting from the 870.Ar inpattern 871template. 872The sequence 873.Ql $0 874is replaced by the original filename. 875Additionally, the sequence 876.Sq Op Ar seq1 , Ar seq2 877is replaced by 878.Ar seq1 879if 880.Ar seq1 881is not a null string; otherwise it is replaced by 882.Ar seq2 . 883For example: 884.Pp 885.Dl nmap $1.$2.$3 [$1,$2].[$2,file] 886.Pp 887This command would yield the output filename 888.Pa myfile.data 889for input filenames 890.Pa myfile.data 891and 892.Pa myfile.data.old ; 893.Pa myfile.file 894for the input filename 895.Pa myfile ; 896and 897.Pa myfile.myfile 898for the input filename 899.Pa .myfile . 900Spaces may be included in 901.Ar outpattern 902by quoting them, 903as in the following example: 904.Bd -literal -offset indent 905nmap $1.$2 "$1 $2" 906.Ed 907.Pp 908Use the 909.Ql \e 910character to prevent special treatment 911of the 912.Ql $ , 913.Ql \&[ , 914.Ql \&] , 915and 916.Ql \&, 917characters. 918.It Ic ntrans Op Ar inchars Op Ar outchars 919Set or unset the filename character translation mechanism. 920If no arguments are specified, the filename character 921translation mechanism is unset. 922If arguments are specified, characters in 923remote filenames are translated during 924.Ic mput 925commands and 926.Ic put 927commands issued without a specified remote target filename. 928If arguments are specified, characters in 929local filenames are translated during 930.Ic mget 931commands and 932.Ic get 933commands issued without a specified local target filename. 934This command is useful when connecting to a non-UNIX remote computer 935with different file naming conventions or practices. 936Characters in a filename matching a character in 937.Ar inchars 938are replaced with the corresponding character in 939.Ar outchars . 940If the character's position in 941.Ar inchars 942is longer than the length of 943.Ar outchars , 944the character is deleted from the file name. 945.It Ic open Ar host Op Ar port 946Establish a connection to the specified 947.Ar host 948FTP server. 949An optional port number may be supplied, 950in which case 951.Nm 952will attempt to contact an FTP server at that port. 953If the 954.Ic auto-login 955option is on (default), 956.Nm 957will also attempt to automatically log the user in to 958the FTP server (see below). 959.It Ic page Ar file 960Retrieve 961.Ic file 962and display with the program defined in 963.Ev PAGER 964(defaulting to 965.Xr more 1 966if 967.Ev PAGER 968is null or not defined). 969.It Ic passive Op Ic on | off 970Toggle passive mode. 971If passive mode is turned on (default is on), 972.Nm 973will send a 974.Dv EPSV 975command for all data connections instead of the usual 976.Dv PORT 977command. 978The 979.Dv PASV 980command requests that the remote server open a port for the data connection 981and return the address of that port. 982The remote server listens on that port and the client connects to it. 983When using the more traditional 984.Dv PORT 985command, the client listens on a port and sends that address to the remote 986server, who connects back to it. 987Passive mode is useful when using 988.Nm 989through a gateway router or host that controls the directionality of 990traffic. 991(Note that though FTP servers are required to support the 992.Dv PASV 993command by RFC 1123, some do not.) 994.It Ic preserve Op Ic on | off 995Toggle preservation of modification times on retrieved files. 996.It Ic progress Op Ic on | off 997Toggle display of transfer progress bar. 998The progress bar will be disabled for a transfer that has 999.Ar local-file 1000as 1001.Sq - 1002or a command that starts with 1003.Sq \&| . 1004Refer to 1005.Sx FILE NAMING CONVENTIONS 1006for more information. 1007.It Ic prompt Op Ic on | off 1008Toggle interactive prompting. 1009Interactive prompting 1010occurs during multiple file transfers to allow the 1011user to selectively retrieve or store files. 1012If prompting is turned off (default is on), any 1013.Ic mget 1014or 1015.Ic mput 1016will transfer all files, and any 1017.Ic mdelete 1018will delete all files. 1019.Pp 1020When prompting is on, the following commands are available at a prompt: 1021.Bl -tag -width 2n -offset indent 1022.It Ic ?\& 1023Print help message. 1024.It Ic a 1025Answer 1026.Dq yes 1027to the current file and automatically answer 1028.Dq yes 1029to any remaining files for the current command. 1030.It Ic n 1031Do not transfer the file. 1032.It Ic p 1033Answer 1034.Dq yes 1035to the current file and turn off prompt mode 1036(as if 1037.Dq prompt off 1038had been given). 1039.It Ic q 1040Answer 1041.Dq no 1042to the current file and automatically answer 1043.Dq no 1044to any remaining files for the current command. 1045.It Ic y 1046Transfer the file. 1047.El 1048.It Ic proxy Ar command 1049Execute an FTP command on a secondary control connection. 1050This command allows simultaneous connection to two remote FTP 1051servers for transferring files between the two servers. 1052The first 1053.Ic proxy 1054command should be an 1055.Ic open , 1056to establish the secondary control connection. 1057Enter the command 1058.Ic proxy ?\& 1059to see other FTP commands executable on the 1060secondary connection. 1061The following commands behave differently when prefaced by 1062.Ic proxy : 1063.Ic open 1064will not define new macros during the auto-login process; 1065.Ic close 1066will not erase existing macro definitions; 1067.Ic get 1068and 1069.Ic mget 1070transfer files from the host on the primary control connection 1071to the host on the secondary control connection; and 1072.Ic put , 1073.Ic mput , 1074and 1075.Ic append 1076transfer files from the host on the secondary control connection 1077to the host on the primary control connection. 1078Third party file transfers depend upon support of the FTP protocol 1079.Dv PASV 1080command by the server on the secondary control connection. 1081.It Ic put Ar local-file Op Ar remote-file 1082Store a local file on the remote machine. 1083If 1084.Ar remote-file 1085is left unspecified, the local file name is used 1086after processing according to any 1087.Ic ntrans 1088or 1089.Ic nmap 1090settings 1091in naming the remote file. 1092File transfer uses the 1093current settings for 1094.Ic type , 1095.Ic format , 1096.Ic mode , 1097and 1098.Ic structure . 1099.It Ic pwd 1100Print the name of the current working directory on the remote 1101machine. 1102.It Ic quit 1103A synonym for 1104.Ic bye . 1105.It Ic quote Ar arg ... 1106The arguments specified are sent, verbatim, to the remote FTP server. 1107.It Ic recv Ar remote-file Op Ar local-file 1108A synonym for 1109.Ic get . 1110.It Ic reget Ar remote-file Op Ar local-file 1111Reget acts like get, except that if 1112.Ar local-file 1113exists and is 1114smaller than 1115.Ar remote-file , 1116.Ar local-file 1117is presumed to be 1118a partially transferred copy of 1119.Ar remote-file 1120and the transfer 1121is continued from the apparent point of failure. 1122This command 1123is useful when transferring very large files over networks that 1124are prone to dropping connections. 1125.It Ic rename Ar from-name to-name 1126Rename the file 1127.Ar from-name 1128on the remote machine to the file 1129.Ar to-name . 1130.It Ic reput Ar local-file Op Ar remote-file 1131Reput acts like put, except that if 1132.Ar remote-file 1133exists and is 1134smaller than 1135.Ar local-file , 1136.Ar remote-file 1137is presumed to be 1138a partially transferred copy of 1139.Ar local-file 1140and the transfer 1141is continued from the apparent point of failure. 1142This command 1143is useful when transferring very large files over networks that 1144are prone to dropping connections. 1145.It Ic reset 1146Clear reply queue. 1147This command re-synchronizes command/reply sequencing with the remote 1148FTP server. 1149Resynchronization may be necessary following a violation of the FTP protocol 1150by the remote server. 1151.It Ic restart Ar marker 1152Restart the immediately following 1153.Ic get 1154or 1155.Ic put 1156at the 1157indicated 1158.Ar marker . 1159On 1160.Ux 1161systems, 1162.Ar marker 1163is usually a byte 1164offset into the file. 1165.It Ic rhelp Op Ar command-name 1166Request help from the remote FTP server. 1167If a 1168.Ar command-name 1169is specified, it is supplied to the server as well. 1170.It Ic rmdir Ar directory-name 1171Delete a directory on the remote machine. 1172.It Ic rstatus Op Ar file 1173With no arguments, show status of remote machine. 1174If 1175.Ar file 1176is specified, show status of 1177.Ar file 1178on remote machine. 1179.It Ic runique Op Ic on | off 1180Toggle storing of files on the local system with unique filenames. 1181If a file already exists with a name equal to the target 1182local filename for a 1183.Ic get 1184or 1185.Ic mget 1186command, a 1187.Dq .1 1188is appended to the name. 1189If the resulting name matches another existing file, 1190a 1191.Dq .2 1192is appended to the original name. 1193If this process continues up to 1194.Dq .99 , 1195an error message is printed, and the transfer does not take place. 1196The generated unique filename will be reported. 1197Note that 1198.Ic runique 1199will not affect local files generated from a shell command 1200(see below). 1201The default value is off. 1202.It Ic send Ar local-file Op Ar remote-file 1203A synonym for 1204.Ic put . 1205.It Ic sendport Op Ic on | off 1206Toggle the use of 1207.Dv PORT 1208commands. 1209By default, 1210.Nm 1211will attempt to use a 1212.Dv PORT 1213command when establishing 1214a connection for each data transfer. 1215The use of 1216.Dv PORT 1217commands can prevent delays 1218when performing multiple file transfers. 1219If the 1220.Dv PORT 1221command fails, 1222.Nm 1223will use the default data port. 1224When the use of 1225.Dv PORT 1226commands is disabled, no attempt will be made to use 1227.Dv PORT 1228commands for each data transfer. 1229This is useful for certain FTP implementations which do ignore 1230.Dv PORT 1231commands but, incorrectly, indicate they've been accepted. 1232.It Ic site Ar arg ... 1233The arguments specified are sent, verbatim, to the remote FTP server as a 1234.Dv SITE 1235command. 1236.It Ic size Ar file 1237Return size of 1238.Ar file 1239on remote machine. 1240.It Ic status 1241Show the current status of 1242.Nm . 1243.\" .It Ic struct Op Ar struct-name 1244.\" Set the file transfer 1245.\" .Ar structure 1246.\" to 1247.\" .Ar struct-name . 1248.\" By default, 1249.\" .Dq file 1250.\" structure is used. 1251.It Ic sunique Op Ic on | off 1252Toggle storing of files on remote machine under unique file names. 1253The remote FTP server must support the FTP protocol 1254.Dv STOU 1255command for 1256successful completion. 1257The remote server will report the unique name. 1258Default value is off. 1259.It Ic system 1260Show the type of operating system running on the remote machine. 1261.It Ic trace Op Ic on | off 1262Toggle packet tracing. 1263.It Ic type Op Ar type-name 1264Set the file transfer 1265.Ic type 1266to 1267.Ar type-name . 1268If no type is specified, the current type 1269is printed. 1270The default type is 1271.Dq binary . 1272.It Ic umask Op Ar newmask 1273Set the default umask on the remote server to 1274.Ar newmask . 1275If 1276.Ar newmask 1277is omitted, the current umask is printed. 1278.It Xo 1279.Ic user Ar username 1280.Op Ar password Op Ar account 1281.Xc 1282Identify yourself to the remote FTP server. 1283If the 1284.Ar password 1285is not specified and the server requires it, 1286.Nm 1287will prompt the user for it (after disabling local echo). 1288If an 1289.Ar account 1290field is not specified, and the FTP server requires it, 1291the user will be prompted for it. 1292If an 1293.Ar account 1294field is specified, an account command will 1295be relayed to the remote server after the login sequence 1296is completed if the remote server did not require it 1297for logging in. 1298Unless 1299.Nm 1300is invoked with 1301.Dq auto-login 1302disabled, this process is done automatically on initial connection to the 1303FTP server. 1304.It Ic verbose Op Ic on | off 1305Toggle verbose mode. 1306In verbose mode, all responses from 1307the FTP server are displayed to the user. 1308In addition, 1309if verbose is on, when a file transfer completes, statistics 1310regarding the efficiency of the transfer are reported. 1311By default, 1312verbose is on. 1313.El 1314.Pp 1315Command arguments which have embedded spaces may be quoted with 1316quote 1317.Pq Ql \&" 1318marks. 1319.Pp 1320Commands which toggle settings can take an explicit 1321.Ic on 1322or 1323.Ic off 1324argument to force the setting appropriately. 1325.Pp 1326If 1327.Nm 1328receives a 1329.Dv SIGINFO 1330(see the 1331.Dq status 1332argument of 1333.Xr stty 1 ) 1334signal whilst a transfer is in progress, the current transfer rate 1335statistics will be written to the standard error output, in the 1336same format as the standard completion message. 1337.Sh AUTO-FETCHING FILES 1338In addition to standard commands, this version of 1339.Nm 1340supports an auto-fetch feature. 1341To enable auto-fetch, simply pass the list of hostnames/files 1342on the command line. 1343.Pp 1344The following formats are valid syntax for an auto-fetch element: 1345.Bl -tag -width Ds 1346.It Ar host : Ns / Ns Ar file Ns Op / 1347.Dq Classic 1348.Nm 1349format. 1350.Sm off 1351.It Xo 1352.Pf ftp:// Op Ar user : password No @ 1353.Ar host Op : Ar port 1354.No / Ar file Op / 1355.Xc 1356.Sm on 1357An FTP URL, retrieved using the FTP protocol if 1358.Ev ftp_proxy 1359isn't defined. 1360Otherwise, transfer using HTTP via the proxy defined in 1361.Ev ftp_proxy . 1362If a 1363.Ar user 1364and 1365.Ar password 1366are given and 1367.Ev ftp_proxy 1368isn't defined, 1369log in as 1370.Ar user 1371with a password of 1372.Ar password . 1373.Sm off 1374.It Xo 1375.Pf http:// Op Ar user : password No @ 1376.Ar host Op : Ar port 1377.No / Ar file 1378.Xc 1379.Sm on 1380An HTTP URL, retrieved using the HTTP protocol. 1381If 1382.Ev http_proxy 1383is defined, it is used as a URL to an HTTP proxy server. 1384If a 1385.Ar user 1386and 1387.Ar password 1388are given and 1389.Ev http_proxy 1390isn't defined, 1391log in as 1392.Ar user 1393with a password of 1394.Ar password 1395using Basic authentication. 1396.Sm off 1397.It Xo 1398.Pf https:// Op Ar user : password No @ 1399.Ar host Op : Ar port 1400.No / Ar file 1401.Xc 1402.Sm on 1403An HTTPS URL, retrieved using the HTTPS protocol. 1404If 1405.Ev http_proxy 1406is defined, this HTTPS proxy server will be used to fetch the 1407file using the CONNECT method. 1408If a 1409.Ar user 1410and 1411.Ar password 1412are given and 1413.Ev http_proxy 1414isn't defined, 1415log in as 1416.Ar user 1417with a password of 1418.Ar password 1419using Basic authentication. 1420.It Pf file: Ar file 1421.Ar file 1422is retrieved from a mounted file system. 1423.El 1424.Pp 1425If a classic format or an FTP URL format has a trailing 1426.Sq / , 1427then 1428.Nm 1429will connect to the site and 1430.Ic cd 1431to the directory given as the path, and leave the user in interactive 1432mode ready for further input. 1433.Pp 1434If 1435.Ar file 1436contains a glob character and globbing is enabled 1437(see 1438.Ic glob ) , 1439then the equivalent of 1440.Ic mget Ar file 1441is performed. 1442.Pp 1443If no 1444.Fl o 1445option is specified, and 1446the directory component of 1447.Ar file 1448contains no globbing characters, 1449then 1450it is stored in the current directory as the 1451.Xr basename 1 1452of 1453.Ar file . 1454If 1455.Fl o Ar output 1456is specified, then 1457.Ar file 1458is stored as 1459.Ar output . 1460Otherwise, the remote name is used as the local name. 1461.Sh ABORTING A FILE TRANSFER 1462To abort a file transfer, use the terminal interrupt key 1463(usually Ctrl-C). 1464Sending transfers will be immediately halted. 1465Receiving transfers will be halted by sending an FTP protocol 1466.Dv ABOR 1467command to the remote server, and discarding any further data received. 1468The speed at which this is accomplished depends upon the remote 1469server's support for 1470.Dv ABOR 1471processing. 1472If the remote server does not support the 1473.Dv ABOR 1474command, an 1475.Ql ftp\*(Gt 1476prompt will not appear until the remote server has completed 1477sending the requested file. 1478.Pp 1479The terminal interrupt key sequence will be ignored when 1480.Nm 1481has completed any local processing and is awaiting a reply 1482from the remote server. 1483A long delay in this mode may result from the ABOR processing described 1484above, or from unexpected behavior by the remote server, including 1485violations of the FTP protocol. 1486If the delay results from unexpected remote server behavior, the local 1487.Nm 1488program must be killed by hand. 1489.Sh FILE NAMING CONVENTIONS 1490Files specified as arguments to 1491.Nm 1492commands are processed according to the following rules. 1493.Bl -enum 1494.It 1495If 1496.Sq - 1497is specified as a local file name, the standard input (for reading) 1498or standard output (for writing) 1499is used. 1500.It 1501If the first character of a local file name is 1502.Sq \&| , 1503the 1504remainder of the argument is interpreted as a shell command. 1505.Nm 1506then forks a shell, using 1507.Xr popen 3 1508with the argument supplied, and reads (writes) from the standard output 1509(standard input). 1510If the shell command includes spaces, the argument 1511must be quoted; e.g., 1512.Qq ls -lt . 1513A particularly 1514useful example of this mechanism is: 1515.Qq ls \&. |more . 1516.It 1517Failing the above checks, if 1518.Dq globbing 1519is enabled, 1520local file names are expanded 1521according to the rules used in the 1522.Xr csh 1 1523.Ic glob 1524command. 1525If the 1526.Nm 1527command expects a single local file (e.g., 1528.Ic put ) , 1529only the first filename generated by the 1530.Dq globbing 1531operation is used. 1532.It 1533For 1534.Ic mget 1535commands and 1536.Ic get 1537commands with unspecified local file names, the local filename is 1538the remote filename, which may be altered by a 1539.Ic case , 1540.Ic ntrans , 1541or 1542.Ic nmap 1543setting. 1544The resulting filename may then be altered if 1545.Ic runique 1546is on. 1547.It 1548For 1549.Ic mput 1550commands and 1551.Ic put 1552commands with unspecified remote file names, the remote filename is 1553the local filename, which may be altered by a 1554.Ic ntrans 1555or 1556.Ic nmap 1557setting. 1558The resulting filename may then be altered by the remote server if 1559.Ic sunique 1560is on. 1561.El 1562.Sh FILE TRANSFER PARAMETERS 1563The FTP specification specifies many parameters which may 1564affect a file transfer. 1565The 1566.Ic type 1567may be one of 1568.Dq ascii , 1569.Dq binary , 1570or 1571.Dq image . 1572.Nm 1573supports the ASCII and image types of file transfer. 1574.Pp 1575.Nm 1576supports only the default values for the remaining 1577file transfer parameters: 1578.Ic mode , 1579.Ic form , 1580and 1581.Ic struct . 1582.Sh THE .netrc FILE 1583The 1584.Pa .netrc 1585file contains login and initialization information 1586used by the auto-login process. 1587It resides in the user's home directory. 1588The following tokens are recognized; they may be separated by spaces, 1589tabs, or new-lines: 1590.Bl -tag -width password 1591.It Ic machine Ar name 1592Identify a remote machine 1593.Ar name . 1594The auto-login process searches the 1595.Pa .netrc 1596file for a 1597.Ic machine 1598token that matches the remote machine specified on the 1599.Nm 1600command line or as an 1601.Ic open 1602command argument. 1603Once a match is made, the subsequent 1604.Pa .netrc 1605tokens are processed, 1606stopping when the end of file is reached or another 1607.Ic machine 1608or a 1609.Ic default 1610token is encountered. 1611.It Ic default 1612This is the same as 1613.Ic machine 1614.Ar name 1615except that 1616.Ic default 1617matches any name. 1618There can be only one 1619.Ic default 1620token, and it must be after all 1621.Ic machine 1622tokens. 1623This is normally used as: 1624.Pp 1625.Dl default login anonymous password user@site 1626.Pp 1627thereby giving the user 1628.Ar automatic 1629anonymous FTP login to 1630machines not specified in 1631.Pa .netrc . 1632This can be overridden 1633by using the 1634.Fl n 1635flag to disable auto-login. 1636.It Ic login Ar name 1637Identify a user on the remote machine. 1638If this token is present, the auto-login process will initiate 1639a login using the specified 1640.Ar name . 1641.It Ic password Ar string 1642Supply a password. 1643If this token is present, the auto-login process will supply the 1644specified string if the remote server requires a password as part 1645of the login process. 1646Note that if this token is present in the 1647.Pa .netrc 1648file for any user other 1649than 1650.Ar anonymous , 1651.Nm 1652will abort the auto-login process if the 1653.Pa .netrc 1654is readable by 1655anyone besides the user. 1656.It Ic account Ar string 1657Supply an additional account password. 1658If this token is present, the auto-login process will supply the 1659specified string if the remote server requires an additional 1660account password, or the auto-login process will initiate an 1661.Dv ACCT 1662command if it does not. 1663.It Ic macdef Ar name 1664Define a macro. 1665This token functions like the 1666.Nm 1667.Ic macdef 1668command functions. 1669A macro is defined with the specified name; its contents begin with the 1670next 1671.Pa .netrc 1672line and continue until a null line (consecutive new-line 1673characters) is encountered. 1674Like the other tokens in the 1675.Pa .netrc 1676file, a 1677.Ic macdef 1678is applicable only to the 1679.Ic machine 1680definition preceding it. 1681A 1682.Ic macdef 1683entry cannot be utilized by multiple 1684.Ic machine 1685definitions; rather, it must be defined following each 1686.Ic machine 1687it is intended to be used with. 1688If a macro named 1689.Ic init 1690is defined, it is automatically executed as the last step in the 1691auto-login process. 1692.El 1693.Sh COMMAND LINE EDITING 1694.Nm 1695supports interactive command line editing, via the 1696.Xr editline 3 1697library. 1698It is enabled with the 1699.Ic edit 1700command, and is enabled by default if input is from a tty. 1701Previous lines can be recalled and edited with the arrow keys, 1702and other GNU Emacs-style editing keys may be used as well. 1703.Pp 1704The 1705.Xr editline 3 1706library is configured with a 1707.Pa .editrc 1708file \- refer to 1709.Xr editrc 5 1710for more information. 1711.Pp 1712An extra key binding is available to 1713.Nm 1714to provide context sensitive command and filename completion 1715(including remote file completion). 1716To use this, bind a key to the 1717.Xr editline 3 1718command 1719.Ic ftp-complete . 1720By default, this is bound to the TAB key. 1721.Sh ENVIRONMENT 1722.Nm 1723utilizes the following environment variables: 1724.Bl -tag -width "FTPSERVERPORT" 1725.It Ev FTPMODE 1726Overrides the default operation mode. 1727Recognized values are: 1728.Pp 1729.Bl -tag -width "passive " -offset indent -compact 1730.It passive 1731passive mode FTP only 1732.It active 1733active mode FTP only 1734.It auto 1735automatic determination of passive or active (this is the default) 1736.It gate 1737gate-ftp mode 1738.El 1739.It Ev FTPSERVER 1740Host to use as gate-ftp server when 1741.Ic gate 1742is enabled. 1743.It Ev FTPSERVERPORT 1744Port to use when connecting to gate-ftp server when 1745.Ic gate 1746is enabled. 1747Default is port returned by a 1748.Fn getservbyname 1749lookup of 1750.Dq ftpgate/tcp . 1751.It Ev HOME 1752For default location of a 1753.Pa .netrc 1754file, if one exists. 1755.It Ev PAGER 1756Used by 1757.Ic page 1758to display files. 1759.It Ev SHELL 1760For default shell. 1761.It Ev ftp_proxy 1762URL of FTP proxy to use when making FTP URL requests 1763(if not defined, use the standard FTP protocol). 1764.It Ev http_proxy 1765URL of HTTP proxy to use when making HTTP or HTTPS URL requests. 1766.It Ev http_cookies 1767Path of a Netscape-like cookiejar file to use when making 1768HTTP or HTTPS URL requests. 1769.El 1770.Sh PORT ALLOCATION 1771For active mode data connections, 1772.Nm 1773will listen to a random high TCP port. 1774The interval of ports used are configurable using 1775.Xr sysctl 8 1776variables 1777.Va net.inet.ip.porthifirst 1778and 1779.Va net.inet.ip.porthilast . 1780.Sh SEE ALSO 1781.Xr basename 1 , 1782.Xr csh 1 , 1783.Xr more 1 , 1784.Xr stty 1 , 1785.Xr tar 1 , 1786.Xr tftp 1 , 1787.Xr editline 3 , 1788.Xr getservbyname 3 , 1789.Xr popen 3 , 1790.Xr editrc 5 , 1791.Xr services 5 , 1792.Xr ftp-proxy 8 , 1793.Xr ftpd 8 1794.Sh STANDARDS 1795.Rs 1796.%A J. Postel 1797.%A J. Reynolds 1798.%D October 1985 1799.%R RFC 959 1800.%T FILE TRANSFER PROTOCOL (FTP) 1801.Re 1802.Pp 1803.Rs 1804.%A P. Hethmon 1805.%D March 2007 1806.%R RFC 3659 1807.%T Extensions to FTP 1808.Re 1809.Sh HISTORY 1810The 1811.Nm 1812command appeared in 1813.Bx 4.2 . 1814.Sh BUGS 1815Correct execution of many commands depends upon proper behavior 1816by the remote server. 1817.Pp 1818In the recursive mode of 1819.Ic mget , 1820files and directories starting with whitespace are ignored 1821because the list cannot be parsed any other way. 1822