⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ftp.texi

📁 压缩包中包含LINUX下多个命令的源码
💻 TEXI
📖 第 1 页 / 共 2 页
字号:
replaced with the corresponding character in outchars. If thecharacter's position in inchars is longer than the length ofoutchars, the character is deleted from the file name.@item open host [port]Establish a connection to the specified host FTP server.  Anoptional port number may be supplied, in which case, ftp willattempt to contact an FTP server at that port.  If the autologinoption is on (default), ftp will also attempt to automatically logthe user in to the FTP server (see below).@item passiveToggle passive mode.  If passive mode is turned on (defaultis off), the ftp client will send a PASV command for all dataconnections instead of the usual PORT command.  The PASV com-mand requests that the remote server open a port for the dataconnection and return the address of that port.  The remoteserver listens on that port and the client connects to it.When using the more traditional PORT command, the client listens on aport and sends that address to the remote server,who connects back to it.  Passive mode is useful when usingftp through a gateway router or host that controls the directionalityof traffic.  (Note that though ftp servers are required to supportthe PASV command by RFC 1123, some do not.)@item promptToggle interactive prompting.  Interactive prompting occursduring multiple file transfers to allow the user to selectively retrieveor store files.  If prompting is turned off(default is on), any mget or mput will transfer all files,and any mdelete will delete all files.@item proxy ftp-commandExecute an ftp command on a secondary control connection.This command allows simultaneous connection to two remote ftpservers for transferring files between the two servers.  Thefirst proxy command should be an open, to establish the secondary controlconnection.  Enter the command "proxy ?" tosee other ftp commands executable on the secondary connection.The following commands behave differently when prefaced by proxy:open will not define new macros during the auto-login process, closewill not erase existing macro definitions, get and mget transfer filesfrom the host on the primary control connection to the host on thesecondary control connection, and put, mput, and append transfer files from thehost on the secondary control connection to the host on theprimary control connection.  Third party file transfers depend upon supportof the ftp protocol PASV command by theserver on the secondary control connection.@item put local-file [remote-file]Store a local file on the remote machine.  If remote-file isleft unspecified, the local file name is used after processing accordingto any ntrans or nmap settings in naming the remote file.File transfer uses the current settings for type, format, mode, and structure.@item pwdPrint the name of the current working directory on the remote machine.@item quitA synonym for bye.@item quote arg1 arg2 ...The arguments specified are sent, verbatim, to the remote FTP server.@item recv remote-file [local-file]A synonym for get.@item reget remote-file [local-file]Reget acts like get, except that if local-file exists and issmaller than remote-file, local-file is presumed to be a partiallytransferred copy of remote-file and the transfer iscontinued from the apparent point of failure.  This commandis useful when transferring very large files over networksthat are prone to dropping connections.@item remotehelp [command-name]Request help from the remote FTP server.  If a command-nameis specified it is supplied to the server as well.@item remotestatus [file-name]With no arguments, show status of remote machine.  If filename isspecified, show status of file-name on remote machine.@item rename [from] [to]Rename the file from on the remote machine, to the file to.@item resetClear reply queue.  This command re-synchronizes command/replysequencing with the remote ftp server.  Resynchronizationmay be necessary following a violation of the ftp protocol bythe remote server.@item restart markerRestart the immediately following get or put at the indicatedmarker. On UNIX systems, marker is usually a byte offset into the file.@item rmdir directory-nameDelete a directory on the remote machine.@item runiqueToggle storing of files on the local system with unique filenames.If a file already exists with a name equal to thetarget local filename for a get or mget command, a ".1" isappended to the name.  If the resulting name matches anotherexisting file, a ".2" is appended to the original name.  Ifthis process continues up to ".99", an error message isprinted, and the transfer does not take place.  The generatedunique filename will be reported.  Note that runique will notaffect local files generated from a shell command (see below).The default value is off.@item send local-file [remote-file]A synonym for put.@item sendportToggle the use of PORT commands.  By default, ftp will attempt to usea PORT command when establishing a connectionfor each data transfer.  The use of PORT commands can preventdelays when performing multiple file transfers.  If the PORTcommand fails, ftp will use the default data port.  When theuse of PORT commands is disabled, no attempt will be made touse PORT commands for each data transfer.  This is useful forcertain FTP implementations which do ignore PORT commandsbut, incorrectly, indicate they've been accepted.@item site arg1 arg2 ...The arguments specified are sent, verbatim, to the remote FTPserver as a SITE command.@item size file-nameReturn size of file-name on remote machine.@item statusShow the current status of ftp.@item struct [struct-name]Set the file transfer structure to struct-name. By default``stream'' structure is used.@item suniqueToggle storing of files on remote machine under unique filenames.  Remote ftp server must support ftp protocol STOU commandfor successful completion.  The remote server will reportunique name.  Default value is off.@item systemShow the type of operating system running on the remote machine.@item tenexSet the file transfer type to that needed to talk to TENEX machines.@item traceToggle packet tracing.@item type [type-name]Set the file transfer type to type-name. If no type is specified,the current type is printed.  The default type is net- work ASCII.@item umask [newmask]Set the default umask on the remote server to newmask. Ifnewmask is omitted, the current umask is printed.@item user user-name [password] [account]Identify yourself to the remote FTP server.  If the passwordis not specified and the server requires it, ftp will promptthe user for it (after disabling local echo).  If an accountfield is not specified, and the FTP server requires it, theuser will be prompted for it.  If an account field is specified,an account command will be relayed to the remote serverafter the login sequence is completed if the remote serverdid not require it for logging in.  Unless ftp is invokedwith ``auto-login'' disabled, this process is done automaticallyon initial connection to the FTP server.@item verboseToggle verbose mode.  In verbose mode, all responses from theFTP server are displayed to the user.  In addition, if verboseis on, when a file transfer completes, statistics regarding theefficiency of the transfer are reported.  By default, verbose is on.@item ? [command]A synonym for help.@end tableCommand arguments which have embedded spaces may be quoted with quote `"'marks.@section Aborting A File TransferTo abort a file transfer, use the terminal interrupt key (usually Ctrl-C).Sending transfers will be immediately halted.  Receiving transferswill be halted by sending a ftp protocol ABOR command to the remote server,and discarding any further data received.  The speed at which this isaccomplished depends upon the remote server's support for ABOR processing.If the remote server does not support the ABOR command, an `ftp>'prompt will not appear until the remote server has completed sending therequested file.The terminal interrupt key sequence will be ignored when ftp has completedany local processing and is awaiting a reply from the remote server.A long delay in this mode may result from the ABOR processing describedabove, or from unexpected behavior by the remote server, including violationsof the ftp protocol.  If the delay results from unexpected remoteserver behavior, the local ftp program must be killed by hand.@section File Naming ConventionsFiles specified as arguments to ftp commands are processed according tothe following rules.@enumerate@itemIf the file name `-' is specified, the stdin (for reading) or stdout(for writing) is used.@itemIf the first character of the file name is `|', the remainder of theargument is interpreted as a shell command.  Ftp then forks a shell,using popen(3) with the argument supplied, and reads (writes) fromthe stdout (stdin).  If the shell command includes spaces, the argumentmust be quoted; e.g.  ``" ls -lt"''.  A particularly useful example ofthis mechanism is: ``dir more''.@itemFailing the above checks, if ``globbing'' is enabled, local filenames are expanded according to the rules used in the csh(1);  c.f.the glob command.  If the ftp command expects a single local file(.e.g.  put), only the first filename generated by the "globbing"operation is used.@itemFor mget commands and get commands with unspecified local filenames, the local filename is the remote filename, which may be altered bya case, ntrans, or nmap setting.  The resulting filenamemay then be altered if runique is on.@itemFor mput commands and put commands with unspecified remote filenames, the remote filename is the local filename, which may be alteredby a ntrans or nmap setting.  The resulting filename may thenbe altered by the remote server if sunique is on.@end enumerate@section File Transfer ParametersThe FTP specification specifies many parameters which may affect a filetransfer.  The type may be one of ``ascii'', ``image'' (binary),``ebcdic'', and ``local byte size'' (for PDP-10's and PDP-20's mostly).Ftp supports the ascii and image types of file transfer, plus local bytesize 8 for tenex mode transfers.Ftp supports only the default values for the remaining file transferparameters: mode, form, and struct.@section The @file{.netrc} FileThe .netrc file contains login and initialization information used by theauto-login process.  It resides in the user's home directory.  The followingtokens are recognized; they may be separated by spaces, tabs, or new-lines:@table @samp@item machine nameIdentify a remote machine name. The auto-login process searchesthe .netrc file for a machine token that matches the remote ma-chine specified on the ftp command line or as an open commandargument.  Once a match is made, the subsequent .netrc tokensare processed, stopping when the end of file is reached or an-other machine or a default token is encountered.@item defaultThis is the same as machine name except that default matchesany name.  There can be only one default token, and it must beafter all machine tokens.  This is normally used as:@example           default login anonymous password user@@site@end examplethereby giving the user automatic anonymous ftp login to machinesnot specified in .netrc. This can be overridden by usingthe -n flag to disable auto-login.@item login nameIdentify a user on the remote machine.  If this token is present,the auto-login process will initiate a login using thespecified name.@item password stringSupply a password.  If this token is present, the auto-loginprocess will supply the specified string if the remote serverrequires a password as part of the login process.  Note that ifthis token is present in the .netrc file for any user otherthan anonymous, ftp will abort the auto-login process if the@file{.netrc} is readable by anyone besides the user.@item account stringSupply an additional account password.  If this token is present,the auto-login process will supply the specified stringif the remote server requires an additional account password,or the auto-login process will initiate an ACCT command if it does not.@item macdef nameDefine a macro.  This token functions like the ftp macdef commandfunctions.  A macro is defined with the specified name;its contents begin with the next .netrc line and continue untila null line (consecutive new-line characters) is encountered.If a macro named init is defined, it is automatically executedas the last step in the auto-login process.@end tableFtp utilizes the following environment variables.@table @samp@item HOMEFor default location of a .netrc file, if one exists.@item SHELLFor default shell.@end tableCorrect execution of many commands depends upon proper behavior by theremote server.An error in the treatment of carriage returns in the 4.2BSD ascii-modetransfer code has been corrected.  This correction may result in incorrecttransfers of binary files to and from 4.2BSD servers using the asciitype.  Avoid this problem by using the binary image type.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -