|
|
1.1 ! root 1: .TH FTP 1C "18 July 1983" ! 2: .UC 4 ! 3: .SH NAME ! 4: ftp \- file transfer program ! 5: .SH SYNOPSIS ! 6: .B ftp ! 7: [ ! 8: .B \-v ! 9: ] [ ! 10: .B \-d ! 11: ] [ ! 12: .B \-i ! 13: ] [ ! 14: .B \-n ! 15: ] [ ! 16: .B \-g ! 17: ] [ ! 18: .B host ! 19: ] ! 20: .SH DESCRIPTION ! 21: .I Ftp ! 22: is the user interface to the ARPANET standard File Transfer Protocol. ! 23: The program allows a user to transfer files to and from a ! 24: remote network site. ! 25: .PP ! 26: The client host with which ! 27: .I ftp ! 28: is to communicate may be specified on the command line. ! 29: If this is done, ! 30: .I ftp ! 31: will immediately attempt to establish a connection to an FTP ! 32: server on that host; otherwise, ! 33: .I ftp ! 34: will enter its command interpreter and await instructions ! 35: from the user. When ! 36: .I ftp ! 37: is awaiting commands from the user the prompt \*(lqftp>\*(rq ! 38: is provided the user. The following commands are recognized ! 39: by ! 40: .IR ftp : ! 41: .TP ! 42: .B \&! ! 43: Invoke a shell on the local machine. ! 44: .TP ! 45: .B \&!command ! 46: Invoke a command on the local machine. ! 47: .TP ! 48: \fBappend\fP \fIlocal-file\fP [ \fIremote-file\fP ] ! 49: Append a local file to a file on the remote machine. If ! 50: .I remote-file ! 51: is left unspecified, the local file name is used in naming the ! 52: remote file. File transfer uses the current settings for ! 53: .IR type , ! 54: .IR format , ! 55: .IR mode , ! 56: and ! 57: .IR structure . ! 58: .TP ! 59: .B ascii ! 60: Set the file transfer ! 61: .I type ! 62: to network ASCII. This is the default type. ! 63: .TP ! 64: .B bell ! 65: Arrange that a bell be sounded after each file transfer ! 66: command is completed. ! 67: .TP ! 68: .B binary ! 69: Set the file transfer ! 70: .I type ! 71: to support binary image transfer. ! 72: .TP ! 73: .B bye ! 74: Terminate the FTP session with the remote server ! 75: and exit ! 76: .IR ftp . ! 77: .TP ! 78: .BI cd " remote-directory" ! 79: Change the working directory on the remote machine ! 80: to ! 81: .IR remote-directory . ! 82: .TP ! 83: .B close ! 84: Terminate the FTP session with the remote server, and ! 85: return to the command interpreter. ! 86: .TP ! 87: .BI delete " remote-file" ! 88: Delete the file ! 89: .I remote-file ! 90: on the remote machine. ! 91: .TP ! 92: \fBdebug\fP [ \fIdebug-value\fP ] ! 93: Toggle debugging mode. If an optional ! 94: .I debug-value ! 95: is specified it is used to set the debugging level. ! 96: When debugging is on, ! 97: .I ftp ! 98: prints each command sent to the remote machine, preceded ! 99: by the string \*(lq-->\*(rq. ! 100: .TP ! 101: \fBdir\fP [ \fIremote-directory\fP ] [ \fIlocal-file\fP ] ! 102: Print a listing of the directory contents in the ! 103: directory, ! 104: .IR remote-directory , ! 105: and, optionally, placing the output in ! 106: .IR local-file . ! 107: If no directory is specified, the current working ! 108: directory on the remote machine is used. If no local ! 109: file is specified, output comes to the terminal. ! 110: .TP ! 111: .BI form " format" ! 112: Set the file transfer ! 113: .I form ! 114: to ! 115: .IR format . ! 116: The default format is \*(lqfile\*(rq. ! 117: .TP ! 118: \fBget\fP \fIremote-file\fP [ \fIlocal-file\fP ] ! 119: Retrieve the ! 120: .I remote-file ! 121: and store it on the local machine. If the local ! 122: file name is not specified, it is given the same ! 123: name it has on the remote machine. ! 124: The current settings for ! 125: .IR type , ! 126: .IR form , ! 127: .IR mode , ! 128: and ! 129: .I structure ! 130: are used while transferring the file. ! 131: .TP ! 132: \fBhash\f ! 133: Toggle hash-sign (``#'') printing for each data block ! 134: transferred. The size of a data block is 1024 bytes. ! 135: .TP ! 136: .B glob ! 137: Toggle file name globbing. With file name globbing enabled, ! 138: each local file or pathname is processed for ! 139: .IR csh (1) ! 140: metacharacters. These characters include ``*?[]~{}''. ! 141: Remote files specified in mutliple item commands, e.g. ! 142: .IR mput , ! 143: are globbed by the remote server. With globbing disabled ! 144: all files and pathnames are treated literally. ! 145: .TP ! 146: \fBhelp\fP [ \fIcommand\fP ] ! 147: Print an informative message about the meaning of ! 148: .IR command . ! 149: If no argument is given, ! 150: .I ftp ! 151: prints a list of the known commands. ! 152: .TP ! 153: \fBlcd\fP [ \fIdirectory\fP ] ! 154: Change the working directory on the local machine. If ! 155: no ! 156: .I directory ! 157: is specified, the user's home directory is used. ! 158: .TP ! 159: \fBls\fP [ \fIremote-directory\fP ] [ \fIlocal-file\fP ] ! 160: Print an abbreviated listing of the contents of a ! 161: directory on the remote machine. If ! 162: .I remote-directory ! 163: is left unspecified, the current working directory ! 164: is used. If no local file is specified, the output ! 165: is sent to the terminal. ! 166: .TP ! 167: \fBmdelete\fP \fIremote-files\fP ! 168: Delete the specified files on the remote machine. If globbing ! 169: is enabled, the specification of remote files will first be ! 170: expanded using ! 171: .IR ls . ! 172: .TP ! 173: \fBmdir\fP \fIremote-files\fP \fIlocal-file\fP ! 174: Obtain a directory listing of multiple files on the remote ! 175: machine and place the result in ! 176: .IR local-file . ! 177: .TP ! 178: \fBmget\fP \fIremote-files\fP ! 179: Retrieve the specified files from the remote machine and ! 180: place them in the current local directory. If globbing ! 181: is enabled, the specification of remote files will first be ! 182: expanding using ! 183: .IR ls . ! 184: .TP ! 185: \fBmkdir\fP \fIdirectory-name\fP ! 186: Make a directory on the remote machine. ! 187: .TP ! 188: \fBmls\fP \fIremote-files\fP \fIlocal-file\fP ! 189: Obtain an abbreviated listing of multiple files on the remote ! 190: machine and place the result in ! 191: .IR local-file . ! 192: .TP ! 193: \fBmode\fP [ \fImode-name\fP ] ! 194: Set the file transfer ! 195: .I mode ! 196: to ! 197: .IR mode-name . ! 198: The default mode is \*(lqstream\*(rq mode. ! 199: .TP ! 200: \fBmput\fP \fIlocal-files\fP ! 201: Transfer multiple local files from the current local directory ! 202: to the current working directory on the remote machine. ! 203: .TP ! 204: \fBopen\fP \fIhost\fP [ \fIport\fP ] ! 205: Establish a connection to the specified ! 206: .I host ! 207: FTP server. An optional port number may be supplied, ! 208: in which case, ! 209: .I ftp ! 210: will attempt to contact an FTP server at that port. ! 211: If the ! 212: .I auto-login ! 213: option is on (default), ! 214: .I ftp ! 215: will also attempt to automatically log the user in to ! 216: the FTP server (see below). ! 217: .TP ! 218: .B prompt ! 219: Toggle interactive prompting. Interactive prompting ! 220: occurs during multiple file transfers to allow the ! 221: user to selectively retrieve or store files. If ! 222: prompting is turned off (default), any ! 223: .I mget ! 224: or ! 225: .I mput ! 226: will transfer all files. ! 227: .TP ! 228: \fBput\fP \fIlocal-file\fP [ \fIremote-file\fP ] ! 229: Store a local file on the remote machine. If ! 230: .I remote-file ! 231: is left unspecified, the local file name is used ! 232: in naming the remote file. File transfer uses the ! 233: current settings for ! 234: .IR type , ! 235: .IR format , ! 236: .IR mode , ! 237: and ! 238: .IR structure . ! 239: .TP ! 240: .B pwd ! 241: Print the name of the current working directory on the remote ! 242: machine. ! 243: .TP ! 244: .B quit ! 245: A synonym for bye. ! 246: .TP ! 247: .BI quote " arg1 arg2 ..." ! 248: The arguments specified are sent, verbatim, to the remote FTP ! 249: server. A single FTP reply code is expected in return. ! 250: .TP ! 251: \fBrecv\fP \fIremote-file\fP [ \fIlocal-file\fP ] ! 252: A synonym for get. ! 253: .TP ! 254: \fBremotehelp\fP [ \fIcommand-name\fP ] ! 255: Request help from the remote FTP server. If a ! 256: .I command-name ! 257: is specified it is supplied to the server as well. ! 258: .TP ! 259: \fBrename\fP [ \fIfrom\fP ] [ \fIto\fP ] ! 260: Rename the file ! 261: .I from ! 262: on the remote machine, to the file ! 263: .IR to . ! 264: .TP ! 265: .BI rmdir " directory-name" ! 266: Delete a directory on the remote machine. ! 267: .TP ! 268: \fBsend\fP \fIlocal-file\fP [ \fIremote-file\fP ] ! 269: A synonym for put. ! 270: .TP ! 271: .B sendport ! 272: Toggle the use of PORT commands. By default, ! 273: .I ftp ! 274: will attempt to use a PORT command when establishing ! 275: a connection for each data transfer. If the PORT ! 276: command fails, ! 277: .I ftp ! 278: will use the default data port. When the use of PORT ! 279: commands is disabled, no attempt will be made to use ! 280: PORT commands for each data transfer. This is useful ! 281: for certain FTP implementations which do ignore PORT ! 282: commands but, incorrectly, indicate they've been accepted. ! 283: .TP ! 284: .B status ! 285: Show the current status of ! 286: .IR ftp . ! 287: .TP ! 288: \fBstruct\fP [ \fIstruct-name\fP ] ! 289: Set the file transfer ! 290: .I structure ! 291: to ! 292: .IR struct-name . ! 293: By default \*(lqstream\*(rq structure is used. ! 294: .TP ! 295: .B tenex ! 296: Set the file transfer type to that needed to ! 297: talk to TENEX machines. ! 298: .TP ! 299: .B trace ! 300: Toggle packet tracing. ! 301: .TP ! 302: \fBtype\fP [ \fItype-name\fP ] ! 303: Set the file transfer ! 304: .I type ! 305: to ! 306: .IR type-name . ! 307: If no type is specified, the current type ! 308: is printed. The default type is network ASCII. ! 309: .TP ! 310: \fBuser\fP \fIuser-name\fP [ \fIpassword\fP ] [ \fIaccount\fP ] ! 311: Identify yourself to the remote FTP server. If the ! 312: password is not specified and the server requires it, ! 313: .I ftp ! 314: will prompt the user for it (after disabling local echo). ! 315: If an account field is not specified, and the FTP server ! 316: requires it, the user will be prompted for it. Unless ! 317: .I ftp ! 318: is invoked with \*(lqauto-login\*(rq disabled, this ! 319: process is done automatically on initial connection to ! 320: the FTP server. ! 321: .TP ! 322: .B verbose ! 323: Toggle verbose mode. In verbose mode, all responses from ! 324: the FTP server are displayed to the user. In addition, ! 325: if verbose is on, when a file transfer completes, statistics ! 326: regarding the efficiency of the transfer are reported. By default, ! 327: verbose is on. ! 328: .TP ! 329: \fB?\fP [ \fIcommand\fP ] ! 330: A synonym for help. ! 331: .PP ! 332: Command arguments which have embedded spaces may be quoted with ! 333: quote (") marks. ! 334: .SH "FILE NAMING CONVENTIONS" ! 335: Files specified as arguments to ! 336: .I ftp ! 337: commands are processed according to the following rules. ! 338: .TP ! 339: 1) ! 340: If the file name \*(lq\-\*(rq is specified, the ! 341: .B stdin ! 342: (for reading) or ! 343: .B stdout ! 344: (for writing) is used. ! 345: .TP ! 346: 2) ! 347: If the first character of the file name is \*(lq|\*(rq, the ! 348: remainder of the argument is interpreted as a shell command. ! 349: .I Ftp ! 350: then forks a shell, using ! 351: .IR popen (3) ! 352: with the argument supplied, and reads (writes) from the stdout ! 353: (stdin). If the shell command includes spaces, the argument ! 354: must be quoted; e.g. \*(lq"| ls -lt"\*(rq. A particularly ! 355: useful example of this mechanism is: \*(lqdir |more\*(rq. ! 356: .TP ! 357: 3) ! 358: Failing the above checks, if ``globbing'' is enabled, ! 359: local file names are expanded ! 360: according to the rules used in the ! 361: .IR csh (1); ! 362: c.f. the ! 363: .I glob ! 364: command. ! 365: .SH "FILE TRANSFER PARAMETERS" ! 366: The FTP specification specifies many parameters which may ! 367: affect a file transfer. The ! 368: .I type ! 369: may be one of \*(lqascii\*(rq, \*(lqimage\*(rq (binary), ! 370: \*(lqebcdic\*(rq, and \*(lqlocal byte size\*(rq (for PDP-10's ! 371: and PDP-20's mostly). ! 372: .I Ftp ! 373: supports the ascii and image types of file transfer. ! 374: .PP ! 375: .I Ftp ! 376: supports only the default values for the remaining ! 377: file transfer parameters: ! 378: .IR mode , ! 379: .IR form , ! 380: and ! 381: .IR struct . ! 382: .SH OPTIONS ! 383: Options may be specified at the command line, or to the ! 384: command interpreter. ! 385: .PP ! 386: The ! 387: .B \-v ! 388: (verbose on) option forces ! 389: .I ftp ! 390: to show all responses from the remote server, as well ! 391: as report on data transfer statistics. ! 392: .PP ! 393: The ! 394: .B \-n ! 395: option restrains ! 396: .I ftp ! 397: from attempting \*(lqauto-login\*(rq upon initial connection. ! 398: If auto-login is enabled, ! 399: .I ftp ! 400: will check the ! 401: .I .netrc ! 402: file in the user's home directory for an entry describing ! 403: an account on the remote machine. If no entry exists, ! 404: .I ftp ! 405: will use the login name on the local machine as the user ! 406: identity on the remote machine, and prompt for a password ! 407: and, optionally, an account with which to login. ! 408: .PP ! 409: The ! 410: .B \-i ! 411: option turns off interactive prompting during ! 412: mutliple file transfers. ! 413: .PP ! 414: The ! 415: .B \-d ! 416: option enables debugging. ! 417: .PP ! 418: The ! 419: .B \-g ! 420: option disables file name globbing. ! 421: .PP ! 422: .SH NOTE ! 423: The syntax of file transfer commands is different from that of ! 424: .B cp(1) ! 425: or ! 426: .B rcp(1C); ! 427: directory names cannot be specified in file transfer commands. ! 428: .SH SEE ALSO ! 429: ftpd(8C) on how FTP server authenticates remote users. ! 430: .SH BUGS ! 431: Many FTP server implementation do not support the experimental ! 432: operations such as print working directory. Aborting a file ! 433: transfer does not work right; if one attempts this the local ! 434: .I ftp ! 435: will likely have to be killed by hand. ! 436: .PP ! 437: If a command is interrupted, ! 438: .I ftp ! 439: does not discard the interrupted command's output which is then ! 440: displayed ! 441: .I after ! 442: the ! 443: .I next ! 444: command is given. The output is quite confusing. ! 445: .PP ! 446: If the user uses the command ! 447: .I sendport ! 448: to reuse the same port number for each file transfer, he should wait ! 449: for approximately 1 minute between each transfer. Otherwise, if the ! 450: FTP server does not retry when failed to connect, the user ! 451: .I ftp ! 452: might hang waiting for the server connection.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.