| 1 | .\" Copyright (c) 1985 The Regents of the University of California. |
| 2 | .\" All rights reserved. |
| 3 | .\" |
| 4 | .\" Redistribution and use in source and binary forms are permitted |
| 5 | .\" provided that the above copyright notice and this paragraph are |
| 6 | .\" duplicated in all such forms and that any documentation, |
| 7 | .\" advertising materials, and other materials related to such |
| 8 | .\" distribution and use acknowledge that the software was developed |
| 9 | .\" by the University of California, Berkeley. The name of the |
| 10 | .\" University may not be used to endorse or promote products derived |
| 11 | .\" from this software without specific prior written permission. |
| 12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR |
| 13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
| 14 | .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 15 | .\" |
| 16 | .\" @(#)ftp.1 6.10 (Berkeley) %G% |
| 17 | .\" |
| 18 | .TH FTP 1 "" |
| 19 | .UC 5 |
| 20 | .SH NAME |
| 21 | ftp \- ARPANET file transfer program |
| 22 | .SH SYNOPSIS |
| 23 | .B ftp |
| 24 | [ |
| 25 | .B \-v |
| 26 | ] [ |
| 27 | .B \-d |
| 28 | ] [ |
| 29 | .B \-i |
| 30 | ] [ |
| 31 | .B \-n |
| 32 | ] [ |
| 33 | .B \-g |
| 34 | ] [ |
| 35 | .B host |
| 36 | ] |
| 37 | .SH DESCRIPTION |
| 38 | .I Ftp |
| 39 | is the user interface to the ARPANET standard File Transfer Protocol. |
| 40 | The program allows a user to transfer files to and from a |
| 41 | remote network site. |
| 42 | .PP |
| 43 | The client host with which |
| 44 | .I ftp |
| 45 | is to communicate may be specified on the command line. |
| 46 | If this is done, |
| 47 | .I ftp |
| 48 | will immediately attempt to establish a connection to an FTP |
| 49 | server on that host; otherwise, |
| 50 | .I ftp |
| 51 | will enter its command interpreter and await instructions |
| 52 | from the user. When |
| 53 | .I ftp |
| 54 | is awaiting commands from the user the prompt \*(lqftp>\*(rq |
| 55 | is provided to the user. The following commands are recognized |
| 56 | by |
| 57 | .IR ftp : |
| 58 | .TP |
| 59 | \fB\&!\fP [ \fIcommand\fP [ \fIargs\fP ] ] |
| 60 | Invoke an interactive shell on the local machine. |
| 61 | If there are arguments, the first is taken to be a command to execute |
| 62 | directly, with the rest of the arguments as its arguments. |
| 63 | .TP |
| 64 | \fB\&$\fP \fImacro-name\fP [ \fIargs\fP ] |
| 65 | Execute the macro \fImacro-name\fP that was defined with the |
| 66 | \fBmacdef\fP command. |
| 67 | Arguments are passed to the macro unglobbed. |
| 68 | .TP |
| 69 | \fBaccount\fP [ \fIpasswd\fP ] |
| 70 | Supply a supplemental password required by a remote system for access |
| 71 | to resources once a login has been successfully completed. |
| 72 | If no argument is included, the user will be prompted for an account |
| 73 | password in a non-echoing input mode. |
| 74 | .TP |
| 75 | \fBappend\fP \fIlocal-file\fP [ \fIremote-file\fP ] |
| 76 | Append a local file to a file on the remote machine. If |
| 77 | .I remote-file |
| 78 | is left unspecified, the local file name is used in naming the |
| 79 | remote file after being altered by any |
| 80 | .I ntrans |
| 81 | or |
| 82 | .I nmap |
| 83 | setting. |
| 84 | File transfer uses the current settings for |
| 85 | .IR type , |
| 86 | .IR format , |
| 87 | .IR mode , |
| 88 | and |
| 89 | .IR structure . |
| 90 | .TP |
| 91 | .B ascii |
| 92 | Set the file transfer |
| 93 | .I type |
| 94 | to network ASCII. This is the default type. |
| 95 | .TP |
| 96 | .B bell |
| 97 | Arrange that a bell be sounded after each file transfer |
| 98 | command is completed. |
| 99 | .TP |
| 100 | .B binary |
| 101 | Set the file transfer |
| 102 | .I type |
| 103 | to support binary image transfer. |
| 104 | .TP |
| 105 | .B bye |
| 106 | Terminate the FTP session with the remote server |
| 107 | and exit |
| 108 | .IR ftp . |
| 109 | An end of file will also terminate the session and exit. |
| 110 | .TP |
| 111 | .B case |
| 112 | Toggle remote computer file name case mapping during |
| 113 | .B mget |
| 114 | commands. |
| 115 | When |
| 116 | .B case |
| 117 | is on (default is off), remote computer file names with all letters in |
| 118 | upper case are written in the local directory with the letters mapped |
| 119 | to lower case. |
| 120 | .TP |
| 121 | .BI cd " remote-directory" |
| 122 | Change the working directory on the remote machine |
| 123 | to |
| 124 | .IR remote-directory . |
| 125 | .TP |
| 126 | .B cdup |
| 127 | Change the remote machine working directory to the parent of the |
| 128 | current remote machine working directory. |
| 129 | .TP |
| 130 | .B close |
| 131 | Terminate the FTP session with the remote server, and |
| 132 | return to the command interpreter. |
| 133 | Any defined macros are erased. |
| 134 | .TP |
| 135 | .B cr |
| 136 | Toggle carriage return stripping during |
| 137 | ascii type file retrieval. |
| 138 | Records are denoted by a carriage return/linefeed sequence |
| 139 | during ascii type file transfer. |
| 140 | When |
| 141 | .B cr |
| 142 | is on (the default), carriage returns are stripped from this |
| 143 | sequence to conform with the UNIX single linefeed record |
| 144 | delimiter. |
| 145 | Records on non-UNIX remote systems may contain single linefeeds; |
| 146 | when an ascii type transfer is made, these linefeeds may be |
| 147 | distinguished from a record delimiter only when |
| 148 | .B cr |
| 149 | is off. |
| 150 | .TP |
| 151 | .BI delete " remote-file" |
| 152 | Delete the file |
| 153 | .I remote-file |
| 154 | on the remote machine. |
| 155 | .TP |
| 156 | \fBdebug\fP [ \fIdebug-value\fP ] |
| 157 | Toggle debugging mode. If an optional |
| 158 | .I debug-value |
| 159 | is specified it is used to set the debugging level. |
| 160 | When debugging is on, |
| 161 | .I ftp |
| 162 | prints each command sent to the remote machine, preceded |
| 163 | by the string \*(lq-->\*(rq. |
| 164 | .TP |
| 165 | \fBdir\fP [ \fIremote-directory\fP ] [ \fIlocal-file\fP ] |
| 166 | Print a listing of the directory contents in the |
| 167 | directory, |
| 168 | .IR remote-directory , |
| 169 | and, optionally, placing the output in |
| 170 | .IR local-file . |
| 171 | If interactive prompting is on, |
| 172 | .I ftp |
| 173 | will prompt the user to verify that the last argument is indeed the |
| 174 | target local file for receiving |
| 175 | .B dir |
| 176 | output. |
| 177 | If no directory is specified, the current working |
| 178 | directory on the remote machine is used. If no local |
| 179 | file is specified, or \fIlocal-file\fP is \fB-\fP, |
| 180 | output comes to the terminal. |
| 181 | .TP |
| 182 | .B disconnect |
| 183 | A synonym for |
| 184 | .BR close . |
| 185 | .TP |
| 186 | .BI form " format" |
| 187 | Set the file transfer |
| 188 | .I form |
| 189 | to |
| 190 | .IR format . |
| 191 | The default format is \*(lqfile\*(rq. |
| 192 | .TP |
| 193 | \fBget\fP \fIremote-file\fP [ \fIlocal-file\fP ] |
| 194 | Retrieve the |
| 195 | .I remote-file |
| 196 | and store it on the local machine. If the local |
| 197 | file name is not specified, it is given the same |
| 198 | name it has on the remote machine, subject to |
| 199 | alteration by the current |
| 200 | .IR case , |
| 201 | .IR ntrans , |
| 202 | and |
| 203 | .I nmap |
| 204 | settings. |
| 205 | The current settings for |
| 206 | .IR type , |
| 207 | .IR form , |
| 208 | .IR mode , |
| 209 | and |
| 210 | .I structure |
| 211 | are used while transferring the file. |
| 212 | .TP |
| 213 | \fBglob\fP |
| 214 | Toggle filename expansion for \fBmdelete\fP, \fBmget\fP and \fBmput\fP. |
| 215 | If globbing is turned off with \fBglob\fP, the file name arguments |
| 216 | are taken literally and not expanded. |
| 217 | Globbing for \fBmput\fP is done as in \fBcsh\fP(1). |
| 218 | For \fBmdelete\fP and \fBmget\fP, each remote file name is expanded |
| 219 | separately on the remote machine and the lists are not merged. |
| 220 | Expansion of a directory name is likely to be |
| 221 | different from expansion of the name of an ordinary file: |
| 222 | the exact result depends on the foreign operating system and ftp server, |
| 223 | and can be previewed by doing `\fBmls\fP\ \fIremote-files\fP\ \fB-\fP'. |
| 224 | Note: \fBmget\fP and \fBmput\fP are not meant to transfer |
| 225 | entire directory subtrees of files. That can be done by |
| 226 | transferring a \fBtar\fP(1) archive of the subtree (in binary mode). |
| 227 | .TP |
| 228 | \fBhash\f |
| 229 | Toggle hash-sign (``#'') printing for each data block |
| 230 | transferred. The size of a data block is 1024 bytes. |
| 231 | .TP |
| 232 | \fBhelp\fP [ \fIcommand\fP ] |
| 233 | Print an informative message about the meaning of |
| 234 | .IR command . |
| 235 | If no argument is given, |
| 236 | .I ftp |
| 237 | prints a list of the known commands. |
| 238 | .TP |
| 239 | \fBlcd\fP [ \fIdirectory\fP ] |
| 240 | Change the working directory on the local machine. If |
| 241 | no |
| 242 | .I directory |
| 243 | is specified, the user's home directory is used. |
| 244 | .TP |
| 245 | \fBls\fP [ \fIremote-directory\fP ] [ \fIlocal-file\fP ] |
| 246 | Print an abbreviated listing of the contents of a |
| 247 | directory on the remote machine. If |
| 248 | .I remote-directory |
| 249 | is left unspecified, the current working directory is used. |
| 250 | If interactive prompting is on, |
| 251 | .I ftp |
| 252 | will prompt the user to verify that the last argument is indeed the |
| 253 | target local file for receiving |
| 254 | .B ls |
| 255 | output. |
| 256 | If no local file is specified, or if \fIlocal-file\fR is \fB-\fR, |
| 257 | the output is sent to the terminal. |
| 258 | .TP |
| 259 | \fBmacdef\fP \fImacro-name\fP |
| 260 | Define a macro. |
| 261 | Subsequent lines are stored as the macro |
| 262 | \fImacro-name\fP; a null line (consecutive newline characters |
| 263 | in a file or |
| 264 | carriage returns from the terminal) terminates macro input mode. |
| 265 | There is a limit of 16 macros and 4096 total characters in all |
| 266 | defined macros. |
| 267 | Macros remain defined until a |
| 268 | .B close |
| 269 | command is executed. |
| 270 | The macro processor interprets '$' and '\\' as special characters. |
| 271 | A '$' followed by a number (or numbers) is replaced by the |
| 272 | corresponding argument on the macro invocation command line. |
| 273 | A '$' followed by an 'i' signals that macro processor that the |
| 274 | executing macro is to be looped. On the first pass '$i' is |
| 275 | replaced by the first argument on the macro invocation command line, |
| 276 | on the second pass it is replaced by the second argument, and so on. |
| 277 | A '\\' followed by any character is replaced by that character. |
| 278 | Use the '\\' to prevent special treatment of the '$'. |
| 279 | .TP |
| 280 | \fBmdelete\fP [ \fIremote-files\fP ] |
| 281 | Delete the \fIremote-files\fP on the remote machine. |
| 282 | .TP |
| 283 | \fBmdir\fP \fIremote-files\fP \fIlocal-file\fP |
| 284 | Like \fBdir\fP, except multiple remote files may be specified. |
| 285 | If interactive prompting is on, |
| 286 | .I ftp |
| 287 | will prompt the user to verify that the last argument is indeed the |
| 288 | target local file for receiving |
| 289 | .B mdir |
| 290 | output. |
| 291 | .TP |
| 292 | \fBmget\fP \fIremote-files\fP |
| 293 | Expand the \fIremote-files\fP on the remote machine |
| 294 | and do a \fBget\fP for each file name thus produced. |
| 295 | See \fBglob\fR for details on the filename expansion. |
| 296 | Resulting file names will then be processed according to |
| 297 | .IR case , |
| 298 | .IR ntrans , |
| 299 | and |
| 300 | .I nmap |
| 301 | settings. |
| 302 | Files are transferred into the local working directory, |
| 303 | which can be changed with `\fBlcd\fP\ directory'; |
| 304 | new local directories can be created with `\fB!\fP\ mkdir\ directory'. |
| 305 | .TP |
| 306 | \fBmkdir\fP \fIdirectory-name\fP |
| 307 | Make a directory on the remote machine. |
| 308 | .TP |
| 309 | \fBmls\fP \fIremote-files\fP \fIlocal-file\fP |
| 310 | Like \fBls\fP, except multiple remote files may be specified. |
| 311 | If interactive prompting is on, |
| 312 | .I ftp |
| 313 | will prompt the user to verify that the last argument is indeed the |
| 314 | target local file for receiving |
| 315 | .B mls |
| 316 | output. |
| 317 | .TP |
| 318 | \fBmode\fP [ \fImode-name\fP ] |
| 319 | Set the file transfer |
| 320 | .I mode |
| 321 | to |
| 322 | .IR mode-name . |
| 323 | The default mode is \*(lqstream\*(rq mode. |
| 324 | .TP |
| 325 | \fBmput\fP \fIlocal-files\fP |
| 326 | Expand wild cards in the list of local files given as arguments |
| 327 | and do a \fBput\fR for each file in the resulting list. |
| 328 | See \fBglob\fP for details of filename expansion. |
| 329 | Resulting file names will then be processed according to |
| 330 | .I ntrans |
| 331 | and |
| 332 | .I nmap |
| 333 | settings. |
| 334 | .TP |
| 335 | \fBnmap\fP [ \fIinpattern\fP \fIoutpattern\fP ] |
| 336 | Set or unset the filename mapping mechanism. |
| 337 | If no arguments are specified, the filename mapping mechanism is unset. |
| 338 | If arguments are specified, remote filenames are mapped during |
| 339 | .B mput |
| 340 | commands and |
| 341 | .B put |
| 342 | commands issued without a specified remote target filename. |
| 343 | If arguments are specified, local filenames are mapped during |
| 344 | .B mget |
| 345 | commands and |
| 346 | .B get |
| 347 | commands issued without a specified local target filename. |
| 348 | This command is useful when connecting to a non-UNIX remote computer |
| 349 | with different file naming conventions or practices. |
| 350 | The mapping follows the pattern set by |
| 351 | .I inpattern |
| 352 | and |
| 353 | .IR outpattern . |
| 354 | .I Inpattern |
| 355 | is a template for incoming filenames (which may have already been |
| 356 | processed according to the |
| 357 | .B ntrans |
| 358 | and |
| 359 | .B case |
| 360 | settings). |
| 361 | Variable templating is accomplished by including the sequences '$1', '$2', ..., '$9' in |
| 362 | .IR inpattern . |
| 363 | Use '\\' to prevent this special treatment of the '$' character. |
| 364 | All other characters are treated literally, and are used to determine the |
| 365 | .B nmap |
| 366 | .I inpattern |
| 367 | variable values. |
| 368 | For exmaple, given |
| 369 | .I inpattern |
| 370 | $1.$2 and the remote file name "mydata.data", $1 would have the value |
| 371 | "mydata", and $2 would have the value "data". |
| 372 | The |
| 373 | .I outpattern |
| 374 | determines the resulting mapped filename. |
| 375 | The sequences '$1', '$2', ...., '$9' are replaced by any value resulting |
| 376 | from the |
| 377 | .I inpattern |
| 378 | template. |
| 379 | The sequence '$0' is replace by the original filename. |
| 380 | Additionally, the sequence '[\fIseq1\fP,\fIseq2\f\P]' is replaced by |
| 381 | .I seq1 |
| 382 | if |
| 383 | .I seq1 |
| 384 | is not a null string; otherwise it is replaced by |
| 385 | .IR seq2 . |
| 386 | For example, the command "nmap $1.$2.$3 [$1,$2].[$2,file]" would yield |
| 387 | the output filename "myfile.data" for input filenames "myfile.data" and |
| 388 | "myfile.data.old", "myfile.file" for the input filename "myfile", and |
| 389 | "myfile.myfile" for the input filename ".myfile". |
| 390 | Spaces may be included in |
| 391 | .IR outpattern , |
| 392 | as in the example: nmap $1 |sed "s/ *$//" > $1 . |
| 393 | Use the '\\' character to prevent special treatment |
| 394 | of the '$', '[', ']', and ',' characters. |
| 395 | .TP |
| 396 | \fBntrans\fP [ \fIinchars\fP [ \fIoutchars\fP ] ] |
| 397 | Set or unset the filename character translation mechanism. |
| 398 | If no arguments are specified, the filename character |
| 399 | translation mechanism is unset. |
| 400 | If arguments are specified, characters in |
| 401 | remote filenames are translated during |
| 402 | .B mput |
| 403 | commands and |
| 404 | .B put |
| 405 | commands issued without a specified remote target filename. |
| 406 | If arguments are specified, characters in |
| 407 | local filenames are translated during |
| 408 | .B mget |
| 409 | commands and |
| 410 | .B get |
| 411 | commands issued without a specified local target filename. |
| 412 | This command is useful when connecting to a non-UNIX remote computer |
| 413 | with different file naming conventions or practices. |
| 414 | Characters in a filename matching a character in |
| 415 | .I inchars |
| 416 | are replaced with the corresponding character in |
| 417 | .IR outchars . |
| 418 | If the character's position in |
| 419 | .I inchars |
| 420 | is longer than the length of |
| 421 | .IR outchars , |
| 422 | the character is deleted from the file name. |
| 423 | .TP |
| 424 | \fBopen\fP \fIhost\fP [ \fIport\fP ] |
| 425 | Establish a connection to the specified |
| 426 | .I host |
| 427 | FTP server. An optional port number may be supplied, |
| 428 | in which case, |
| 429 | .I ftp |
| 430 | will attempt to contact an FTP server at that port. |
| 431 | If the |
| 432 | .I auto-login |
| 433 | option is on (default), |
| 434 | .I ftp |
| 435 | will also attempt to automatically log the user in to |
| 436 | the FTP server (see below). |
| 437 | .TP |
| 438 | .B prompt |
| 439 | Toggle interactive prompting. Interactive prompting |
| 440 | occurs during multiple file transfers to allow the |
| 441 | user to selectively retrieve or store files. |
| 442 | If prompting is turned off (default is on), any \fBmget\fP or \fBmput\fP |
| 443 | will transfer all files, and any \fBmdelete\fP will delete all files. |
| 444 | .TP |
| 445 | \fBproxy\fP \fIftp-command\fP |
| 446 | Execute an ftp command on a secondary control connection. |
| 447 | This command allows simultaneous connection to two remote ftp |
| 448 | servers for transferring files between the two servers. |
| 449 | The first |
| 450 | .B proxy |
| 451 | command should be an |
| 452 | .BR open , |
| 453 | to establish the secondary control connection. |
| 454 | Enter the command "proxy ?" to see other ftp commands executable on the |
| 455 | secondary connection. |
| 456 | The following commands behave differently when prefaced by |
| 457 | .BR proxy : |
| 458 | .B open |
| 459 | will not define new macros during the auto-login process, |
| 460 | .B close |
| 461 | will not erase existing macro definitions, |
| 462 | .B get |
| 463 | and |
| 464 | .B mget |
| 465 | transfer files from the host on the primary control connection |
| 466 | to the host on the secondary control connection, and |
| 467 | .BR put , |
| 468 | .BR mput , |
| 469 | and |
| 470 | .B append |
| 471 | transfer files from the host on the secondary control connection |
| 472 | to the host on the primary control connection. |
| 473 | Third party file transfers depend upon support of the ftp protocol |
| 474 | PASV command by the server on the secondary control connection. |
| 475 | .TP |
| 476 | \fBput\fP \fIlocal-file\fP [ \fIremote-file\fP ] |
| 477 | Store a local file on the remote machine. If |
| 478 | .I remote-file |
| 479 | is left unspecified, the local file name is used |
| 480 | after processing according to any |
| 481 | .I ntrans |
| 482 | or |
| 483 | .I nmap |
| 484 | settings |
| 485 | in naming the remote file. File transfer uses the |
| 486 | current settings for |
| 487 | .IR type , |
| 488 | .IR format , |
| 489 | .IR mode , |
| 490 | and |
| 491 | .IR structure . |
| 492 | .TP |
| 493 | .B pwd |
| 494 | Print the name of the current working directory on the remote |
| 495 | machine. |
| 496 | .TP |
| 497 | .B quit |
| 498 | A synonym for |
| 499 | .BR bye . |
| 500 | .TP |
| 501 | .BI quote " arg1 arg2 ..." |
| 502 | The arguments specified are sent, verbatim, to the remote FTP |
| 503 | server. |
| 504 | .TP |
| 505 | \fBrecv\fP \fIremote-file\fP [ \fIlocal-file\fP ] |
| 506 | A synonym for get. |
| 507 | .TP |
| 508 | \fBremotehelp\fP [ \fIcommand-name\fP ] |
| 509 | Request help from the remote FTP server. If a |
| 510 | .I command-name |
| 511 | is specified it is supplied to the server as well. |
| 512 | .TP |
| 513 | \fBrename\fP [ \fIfrom\fP ] [ \fIto\fP ] |
| 514 | Rename the file |
| 515 | .I from |
| 516 | on the remote machine, to the file |
| 517 | .IR to . |
| 518 | .TP |
| 519 | .B reset |
| 520 | Clear reply queue. |
| 521 | This command re-synchronizes command/reply sequencing with the remote |
| 522 | ftp server. |
| 523 | Resynchronization may be neccesary following a violation of the ftp protocol |
| 524 | by the remote server. |
| 525 | .TP |
| 526 | .BI rmdir " directory-name" |
| 527 | Delete a directory on the remote machine. |
| 528 | .TP |
| 529 | .B runique |
| 530 | Toggle storing of files on the local system with unique filenames. |
| 531 | If a file already exists with a name equal to the target |
| 532 | local filename for a |
| 533 | .B get |
| 534 | or |
| 535 | .B mget |
| 536 | command, a ".1" is appended to the name. |
| 537 | If the resulting name matches another existing file, |
| 538 | a ".2" is appended to the original name. |
| 539 | If this process continues up to ".99", an error |
| 540 | message is printed, and the transfer does not take place. |
| 541 | The generated unique filename will be reported. |
| 542 | Note that |
| 543 | .B runique |
| 544 | will not affect local files generated from a shell command |
| 545 | (see below). |
| 546 | The default value is off. |
| 547 | .TP |
| 548 | \fBsend\fP \fIlocal-file\fP [ \fIremote-file\fP ] |
| 549 | A synonym for put. |
| 550 | .TP |
| 551 | .B sendport |
| 552 | Toggle the use of PORT commands. By default, |
| 553 | .I ftp |
| 554 | will attempt to use a PORT command when establishing |
| 555 | a connection for each data transfer. |
| 556 | The use of PORT commands can prevent delays |
| 557 | when performing multiple file transfers. If the PORT |
| 558 | command fails, |
| 559 | .I ftp |
| 560 | will use the default data port. When the use of PORT |
| 561 | commands is disabled, no attempt will be made to use |
| 562 | PORT commands for each data transfer. This is useful |
| 563 | for certain FTP implementations which do ignore PORT |
| 564 | commands but, incorrectly, indicate they've been accepted. |
| 565 | .TP |
| 566 | .B status |
| 567 | Show the current status of |
| 568 | .IR ftp . |
| 569 | .TP |
| 570 | \fBstruct\fP [ \fIstruct-name\fP ] |
| 571 | Set the file transfer |
| 572 | .I structure |
| 573 | to |
| 574 | .IR struct-name . |
| 575 | By default \*(lqstream\*(rq structure is used. |
| 576 | .TP |
| 577 | .B sunique |
| 578 | Toggle storing of files on remote machine under unique file names. |
| 579 | Remote ftp server must support ftp protocol STOU command for |
| 580 | successful completion. |
| 581 | The remote server will report unique name. |
| 582 | Default value is off. |
| 583 | .TP |
| 584 | .B tenex |
| 585 | Set the file transfer type to that needed to |
| 586 | talk to TENEX machines. |
| 587 | .TP |
| 588 | .B trace |
| 589 | Toggle packet tracing. |
| 590 | .TP |
| 591 | \fBtype\fP [ \fItype-name\fP ] |
| 592 | Set the file transfer |
| 593 | .I type |
| 594 | to |
| 595 | .IR type-name . |
| 596 | If no type is specified, the current type |
| 597 | is printed. The default type is network ASCII. |
| 598 | .TP |
| 599 | \fBuser\fP \fIuser-name\fP [ \fIpassword\fP ] [ \fIaccount\fP ] |
| 600 | Identify yourself to the remote FTP server. If the |
| 601 | password is not specified and the server requires it, |
| 602 | .I ftp |
| 603 | will prompt the user for it (after disabling local echo). |
| 604 | If an account field is not specified, and the FTP server |
| 605 | requires it, the user will be prompted for it. |
| 606 | If an account field is specified, an account command will |
| 607 | be relayed to the remote server after the login sequence |
| 608 | is completed if the remote server did not require it |
| 609 | for logging in. |
| 610 | Unless |
| 611 | .I ftp |
| 612 | is invoked with \*(lqauto-login\*(rq disabled, this |
| 613 | process is done automatically on initial connection to |
| 614 | the FTP server. |
| 615 | .TP |
| 616 | .B verbose |
| 617 | Toggle verbose mode. In verbose mode, all responses from |
| 618 | the FTP server are displayed to the user. In addition, |
| 619 | if verbose is on, when a file transfer completes, statistics |
| 620 | regarding the efficiency of the transfer are reported. By default, |
| 621 | verbose is on. |
| 622 | .TP |
| 623 | \fB?\fP [ \fIcommand\fP ] |
| 624 | A synonym for help. |
| 625 | .PP |
| 626 | Command arguments which have embedded spaces may be quoted with |
| 627 | quote (") marks. |
| 628 | .SH "ABORTING A FILE TRANSFER" |
| 629 | To abort a file transfer, use the terminal interrupt key |
| 630 | (usually Ctrl-C). |
| 631 | Sending transfers will be immediately halted. |
| 632 | Receiving transfers will be halted by sending a ftp protocol ABOR |
| 633 | command to the remote server, and discarding any further data received. |
| 634 | The speed at which this is accomplished depends upon the remote |
| 635 | server's support for ABOR processing. |
| 636 | If the remote server does not support the ABOR command, an "ftp>" |
| 637 | prompt will not appear until the remote server has completed |
| 638 | sending the requested file. |
| 639 | .PP |
| 640 | The terminal interrupt key sequence will be ignored when |
| 641 | .I ftp |
| 642 | has completed any local processing and is awaiting a reply |
| 643 | from the remote server. |
| 644 | A long delay in this mode may result from the ABOR processing described |
| 645 | above, or from unexpected behavior by the remote server, including |
| 646 | violations of the ftp protocol. |
| 647 | If the delay results from unexpected remote server behavior, the local |
| 648 | .I ftp |
| 649 | program must be killed by hand. |
| 650 | .SH "FILE NAMING CONVENTIONS" |
| 651 | Files specified as arguments to |
| 652 | .I ftp |
| 653 | commands are processed according to the following rules. |
| 654 | .TP |
| 655 | 1) |
| 656 | If the file name \*(lq\-\*(rq is specified, the |
| 657 | .B stdin |
| 658 | (for reading) or |
| 659 | .B stdout |
| 660 | (for writing) is used. |
| 661 | .TP |
| 662 | 2) |
| 663 | If the first character of the file name is \*(lq|\*(rq, the |
| 664 | remainder of the argument is interpreted as a shell command. |
| 665 | .I Ftp |
| 666 | then forks a shell, using |
| 667 | .IR popen (3) |
| 668 | with the argument supplied, and reads (writes) from the stdout |
| 669 | (stdin). If the shell command includes spaces, the argument |
| 670 | must be quoted; e.g. \*(lq"| ls -lt"\*(rq. A particularly |
| 671 | useful example of this mechanism is: \*(lqdir |more\*(rq. |
| 672 | .TP |
| 673 | 3) |
| 674 | Failing the above checks, if ``globbing'' is enabled, |
| 675 | local file names are expanded |
| 676 | according to the rules used in the |
| 677 | .IR csh (1); |
| 678 | c.f. the |
| 679 | .I glob |
| 680 | command. |
| 681 | If the |
| 682 | .I ftp |
| 683 | command expects a single local file ( .e.g. |
| 684 | .BR put ), |
| 685 | only the first filename generated by the "globbing" operation is used. |
| 686 | .TP |
| 687 | 4) |
| 688 | For |
| 689 | .B mget |
| 690 | commands and |
| 691 | .B get |
| 692 | commands with unspecified local file names, the local filename is |
| 693 | the remote filename, which may be altered by a |
| 694 | .BR case , |
| 695 | .BR ntrans , |
| 696 | or |
| 697 | .B nmap |
| 698 | setting. |
| 699 | The resulting filename may then be altered if |
| 700 | .B runique |
| 701 | is on. |
| 702 | .TP |
| 703 | 5) |
| 704 | For |
| 705 | .B mput |
| 706 | commands and |
| 707 | .B put |
| 708 | commands with unspecified remote file names, the remote filename is |
| 709 | the local filename, which may be altered by a |
| 710 | .B ntrans |
| 711 | or |
| 712 | .B nmap |
| 713 | setting. |
| 714 | The resulting filename may then be altered by the remote server if |
| 715 | .B sunique |
| 716 | is on. |
| 717 | .SH "FILE TRANSFER PARAMETERS" |
| 718 | The FTP specification specifies many parameters which may |
| 719 | affect a file transfer. The |
| 720 | .I type |
| 721 | may be one of \*(lqascii\*(rq, \*(lqimage\*(rq (binary), |
| 722 | \*(lqebcdic\*(rq, and \*(lqlocal byte size\*(rq (for PDP-10's |
| 723 | and PDP-20's mostly). |
| 724 | .I Ftp |
| 725 | supports the ascii and image types of file transfer, |
| 726 | plus local byte size 8 for \fBtenex\fP mode transfers. |
| 727 | .PP |
| 728 | .I Ftp |
| 729 | supports only the default values for the remaining |
| 730 | file transfer parameters: |
| 731 | .IR mode , |
| 732 | .IR form , |
| 733 | and |
| 734 | .IR struct . |
| 735 | .SH OPTIONS |
| 736 | Options may be specified at the command line, or to the |
| 737 | command interpreter. |
| 738 | .PP |
| 739 | The |
| 740 | .B \-v |
| 741 | (verbose on) option forces |
| 742 | .I ftp |
| 743 | to show all responses from the remote server, as well |
| 744 | as report on data transfer statistics. |
| 745 | .PP |
| 746 | The |
| 747 | .B \-n |
| 748 | option restrains |
| 749 | .I ftp |
| 750 | from attempting \*(lqauto-login\*(rq upon initial connection. |
| 751 | If auto-login is enabled, |
| 752 | .I ftp |
| 753 | will check the |
| 754 | .I .netrc |
| 755 | (see below) file in the user's home directory for an entry describing |
| 756 | an account on the remote machine. If no entry exists, |
| 757 | .I ftp |
| 758 | will prompt for the remote machine login name (default is the user |
| 759 | identity on the local machine), and, if necessary, prompt for a password |
| 760 | and an account with which to login. |
| 761 | .PP |
| 762 | The |
| 763 | .B \-i |
| 764 | option turns off interactive prompting during |
| 765 | multiple file transfers. |
| 766 | .PP |
| 767 | The |
| 768 | .B \-d |
| 769 | option enables debugging. |
| 770 | .PP |
| 771 | The |
| 772 | .B \-g |
| 773 | option disables file name globbing. |
| 774 | .SH "THE .netrc FILE" |
| 775 | The .netrc file contains login and initialization information |
| 776 | used by the auto-login process. |
| 777 | It resides in the user's home directory. |
| 778 | The following tokens are recognized; they may be separated by spaces, |
| 779 | tabs, or new-lines: |
| 780 | .TP |
| 781 | \fBmachine\fP \fIname\fP |
| 782 | Identify a remote machine name. |
| 783 | The auto-login process searches the .netrc file for a |
| 784 | .B machine |
| 785 | token that matches the remote machine specified on the |
| 786 | .I ftp |
| 787 | command line or as an |
| 788 | .B open |
| 789 | command argument. |
| 790 | Once a match is made, the subsequent .netrc tokens are processed, |
| 791 | stopping when the end of file is reached or another |
| 792 | .B machine |
| 793 | token is encountered. |
| 794 | .TP |
| 795 | \fBlogin\fP \fIname\fP |
| 796 | Identify a user on the remote machine. |
| 797 | If this token is present, the auto-login process will initiate |
| 798 | a login using the specified name. |
| 799 | .TP |
| 800 | \fBpassword\fP \fIstring\fP |
| 801 | Supply a password. |
| 802 | If this token is present, the auto-login process will supply the |
| 803 | specified string if the remote server requires a password as part |
| 804 | of the login process. |
| 805 | Note that if this token is present in the .netrc file, |
| 806 | .I ftp |
| 807 | will abort the auto-login process if the .netrc is readable by |
| 808 | anyone besides the user. |
| 809 | .TP |
| 810 | \fBaccount\fP \fIstring\fP |
| 811 | Supply an additional account password. |
| 812 | If this token is present, the auto-login process will supply the |
| 813 | specified string if the remote server requires an additional |
| 814 | account password, or the auto-login process will initiate an |
| 815 | ACCT command if it does not. |
| 816 | .TP |
| 817 | \fBmacdef\fP \fIname\fP |
| 818 | Define a macro. |
| 819 | This token functions like the |
| 820 | .I ftp |
| 821 | .B macdef |
| 822 | command functions. |
| 823 | A macro is defined with the specified name; its contents begin with the |
| 824 | next .netrc line and continue until a null line (consecutive new-line |
| 825 | characters) is encountered. |
| 826 | If a macro named |
| 827 | .I init |
| 828 | is defined, it is automatically executed as the last step in the |
| 829 | auto-login process. |
| 830 | .SH "SEE ALSO" |
| 831 | ftpd(8) |
| 832 | .SH BUGS |
| 833 | Correct execution of many commands depends upon proper behavior |
| 834 | by the remote server. |
| 835 | .PP |
| 836 | An error in the treatment of carriage returns |
| 837 | in the 4.2BSD UNIX ascii-mode transfer code |
| 838 | has been corrected. |
| 839 | This correction may result in incorrect transfers of binary files |
| 840 | to and from 4.2BSD servers using the ascii type. |
| 841 | Avoid this problem by using the binary image type. |