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

📄 ftp.1

📁 UNIX FTP client
💻 1
📖 第 1 页 / 共 2 页
字号:
.\" Copyright (c) 1985, 1989, 1990 The Regents of the University of California..\" All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\"    notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\"    notice, this list of conditions and the following disclaimer in the.\"    documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\"    must display the following acknowledgement:.\"	This product includes software developed by the University of.\"	California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\"    may be used to endorse or promote products derived from this software.\"    without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\"	from: @(#)ftp.1	6.18 (Berkeley) 7/30/91.\"	$Id: ftp.1,v 1.2 1997/06/08 20:01:35 dholland Exp $.\".Dd July 30, 1991.Dt FTP 1.Os BSD 4.2.Sh NAME.Nm ftp.Nd.Tn ARPANETfile transfer program.Sh SYNOPSIS.Nm ftp.Op Fl v.Op Fl d.Op Fl i.Op Fl n.Op Fl g.Op Ar host.Sh DESCRIPTION.Nm Ftpis the user interface to the.Tn ARPANETstandard File Transfer Protocol.The program allows a user to transfer files to and from aremote network site..PpOptions may be specified at the command line, or to thecommand interpreter..Bl -tag -width flag.It Fl vVerbose option forces.Nm ftpto show all responses from the remote server, as wellas report on data transfer statistics..It Fl nRestrains.Nm ftpfrom attempting \*(Lqauto-login\*(Rq upon initial connection.If auto-login is enabled,.Nm ftpwill check the.Pa .netrc(see below) file in the user's home directory for an entry describingan account on the remote machine.If no entry exists,.Nm ftpwill prompt for the remote machine login name (default is the useridentity on the local machine), and, if necessary, prompt for a passwordand an account with which to login..It Fl iTurns off interactive prompting duringmultiple file transfers..It Fl dEnables debugging..It Fl gDisables file name globbing..El.PpThe client host with which.Nm ftpis to communicate may be specified on the command line.If this is done,.Nm ftpwill immediately attempt to establish a connection to an.Tn FTPserver on that host; otherwise,.Nm ftpwill enter its command interpreter and await instructionsfrom the user.When.Nm ftpis awaiting commands from the user the prompt.Ql ftp>is provided to the user.The following commands are recognizedby.Nm ftp  :.Bl -tag -width Fl.It Ic \&! Op Ar command Op Ar argsInvoke an interactive shell on the local machine.If there are arguments, the first is taken to be a command to executedirectly, with the rest of the arguments as its arguments..It Ic \&$ Ar macro-name Op Ar argsExecute the macro.Ar macro-namethat was defined with the.Ic macdefcommand.Arguments are passed to the macro unglobbed..It Ic account Op Ar passwdSupply a supplemental password required by a remote system for accessto resources once a login has been successfully completed.If no argument is included, the user will be prompted for an accountpassword in a non-echoing input mode..It Ic append Ar local-file Op Ar remote-fileAppend a local file to a file on the remote machine.If.Ar remote-fileis left unspecified, the local file name is used in naming theremote file after being altered by any.Ic ntransor.Ic nmapsetting.File transfer uses the current settings for.Ic type  ,.Ic format ,.Ic mode  ,and.Ic structure ..It Ic asciiSet the file transfer.Ic typeto network.Tn ASCII .This is the default type..It Ic bellArrange that a bell be sounded after each file transfercommand is completed..It Ic binarySet the file transfer.Ic typeto support binary image transfer..It Ic byeTerminate the.Tn FTPsession with the remote serverand exit.Nm ftp  .An end of file will also terminate the session and exit..It Ic caseToggle remote computer file name case mapping during.Ic mgetcommands.When.Ic caseis on (default is off), remote computer file names with all letters inupper case are written in the local directory with the letters mappedto lower case..It Ic \&cd Ar remote-directoryChange the working directory on the remote machineto.Ar remote-directory  ..It Ic cdupChange the remote machine working directory to the parent of thecurrent remote machine working directory..It Ic chmod Ar mode file-nameChange the permission modes of the file.Ar file-nameon the remotesytem to.Ar mode  ..It Ic closeTerminate the.Tn FTPsession with the remote server, andreturn to the command interpreter.Any defined macros are erased..It Ic \&crToggle carriage return stripping duringascii type file retrieval.Records are denoted by a carriage return/linefeed sequenceduring ascii type file transfer.When.Ic \&cris on (the default), carriage returns are stripped from thissequence to conform with the.Uxsingle linefeed recorddelimiter.Records on.Pf non\- Ns Uxremote systems may contain single linefeeds;when an ascii type transfer is made, these linefeeds may bedistinguished from a record delimiter only when.Ic \&cris off..It Ic delete Ar remote-fileDelete the file.Ar remote-fileon the remote machine..It Ic debug Op Ar debug-valueToggle debugging mode.If an optional.Ar debug-valueis specified it is used to set the debugging level.When debugging is on,.Nm ftpprints each command sent to the remote machine, precededby the string.Ql \-\->.It Xo.Ic dir.Op Ar remote-directory.Op Ar local-file.XcPrint a listing of the directory contents in thedirectory,.Ar remote-directory  ,and, optionally, placing the output in.Ar local-file  .If interactive prompting is on,.Nm ftpwill prompt the user to verify that the last argument is indeed thetarget local file for receiving.Ic diroutput.If no directory is specified, the current workingdirectory on the remote machine is used.If no localfile is specified, or.Ar local-fileis.Fl  ,output comes to the terminal..It Ic disconnectA synonym for.Ar close  ..It Ic form Ar formatSet the file transfer.Ic formto.Ar format  .The default format is \*(Lqfile\*(Rq..It Ic get Ar remote-file Op Ar local-fileRetrieve the.Ar remote-fileand store it on the local machine.If the localfile name is not specified, it is given the samename it has on the remote machine, subject toalteration by the current.Ic case  ,.Ic ntrans ,and.Ic nmapsettings.The current settings for.Ic type  ,.Ic form ,.Ic mode  ,and.Ic structureare used while transferring the file..It Ic globToggle filename expansion for.Ic mdelete  ,.Ic mgetand.Ic mput  .If globbing is turned off with.Ic glob  ,the file name argumentsare taken literally and not expanded.Globbing for.Ic mputis done as in.Xr csh 1 .For.Ic mdeleteand.Ic mget  ,each remote file name is expandedseparately on the remote machine and the lists are not merged.Expansion of a directory name is likely to bedifferent from expansion of the name of an ordinary file:the exact result depends on the foreign operating system and ftp server,and can be previewed by doing.Ql mls remote-files \-Note:.Ic mgetand.Ic mputare not meant to transferentire directory subtrees of files.That can be done bytransferring a.Xr tar 1archive of the subtree (in binary mode)..It Ic hashToggle hash-sign (``#'') printing for each data blocktransferred.The size of a data block is 1024 bytes..It Ic help Op Ar commandPrint an informative message about the meaning of.Ar command  .If no argument is given,.Nm ftpprints a list of the known commands..It Ic idle Op Ar secondsSet the inactivity timer on the remote server to.Ar secondsseconds.If.Ar secondsis ommitted, the current inactivity timer is printed..It Ic lcd Op Ar directoryChange the working directory on the local machine.Ifno.Ar directoryis specified, the user's home directory is used..It Xo.Ic \&ls.Op Ar remote-directory.Op Ar local-file.XcPrint a listing of the contents of adirectory on the remote machine.The listing includes any system-dependent information that the serverchooses to include; for example, most.Uxsystems will produceoutput from the command.Ql ls \-l .(See also.Ic nlist . )If.Ar remote-directoryis left unspecified, the current working directory is used.If interactive prompting is on,.Nm ftpwill prompt the user to verify that the last argument is indeed thetarget local file for receiving.Ic \&lsoutput.If no local file is specified, or if.Ar local-fileis.Sq Fl ,the output is sent to the terminal..It Ic macdef Ar macro-nameDefine a macro.Subsequent lines are stored as the macro.Ar macro-name  ;a null line (consecutive newline charactersin a file orcarriage returns from the terminal) terminates macro input mode.There is a limit of 16 macros and 4096 total characters in alldefined macros.Macros remain defined until a.Ic closecommand is executed.The macro processor interprets `$' and `\e' as special characters.A `$' followed by a number (or numbers) is replaced by thecorresponding argument on the macro invocation command line.A `$' followed by an `i' signals that macro processor that theexecuting macro is to be looped.On the first pass `$i' isreplaced by the first argument on the macro invocation command line,on the second pass it is replaced by the second argument, and so on.A `\e' followed by any character is replaced by that character.Use the `\e' to prevent special treatment of the `$'..It Ic mdelete Op Ar remote-filesDelete the.Ar remote-fileson the remote machine..It Ic mdir Ar remote-files local-fileLike.Ic dir  ,except multiple remote files may be specified.If interactive prompting is on,.Nm ftpwill prompt the user to verify that the last argument is indeed thetarget local file for receiving.Ic mdiroutput..It Ic mget Ar remote-filesExpand the.Ar remote-fileson the remote machineand do a.Ic getfor each file name thus produced.See.Ic globfor details on the filename expansion.Resulting file names will then be processed according to.Ic case  ,.Ic ntrans ,and.Ic nmapsettings.Files are transferred into the local working directory,which can be changed with.Ql lcd directory ;new local directories can be created with.Ql "\&! mkdir directory" ..It Ic mkdir Ar directory-nameMake a directory on the remote machine..It Ic mls Ar remote-files local-fileLike.Ic nlist  ,except multiple remote files may be specified,and the.Ar local-filemust be specified.If interactive prompting is on,.Nm ftpwill prompt the user to verify that the last argument is indeed thetarget local file for receiving.Ic mlsoutput..It Ic mode Op Ar mode-nameSet the file transfer.Ic modeto.Ar mode-name  .The default mode is \*(Lqstream\*(Rq mode..It Ic modtime Ar file-nameShow the last modification time of the file on the remote machine..It Ic mput Ar local-filesExpand wild cards in the list of local files given as argumentsand do a.Ic putfor each file in the resulting list.See.Ic globfor details of filename expansion.Resulting file names will then be processed according to.Ic ntransand.Ic nmapsettings..It Ic newer Ar file-name Op Ar local-fileGet the file only if the modification time of the remote file is morerecent that the file on the current system.If the file does notexist on the current system, the remote file is considered.Ic newer  .Otherwise, this command is identical to.Ar get  ..It Xo.Ic nlist.Op Ar remote-directory.Op Ar local-file.XcPrint a  list of the files in adirectory on the remote machine.If.Ar remote-directoryis left unspecified, the current working directory is used.If interactive prompting is on,.Nm ftpwill prompt the user to verify that the last argument is indeed thetarget local file for receiving.Ic nlistoutput.If no local file is specified, or if.Ar local-fileis.Fl  ,the output is sent to the terminal..It Ic nmap Op Ar inpattern outpatternSet or unset the filename mapping mechanism.If no arguments are specified, the filename mapping mechanism is unset.If arguments are specified, remote filenames are mapped during.Ic mputcommands and.Ic putcommands issued without a specified remote target filename.If arguments are specified, local filenames are mapped during.Ic mgetcommands and.Ic getcommands issued without a specified local target filename.This command is useful when connecting to a.No non\- Ns Uxremote computerwith different file naming conventions or practices.The mapping follows the pattern set by.Ar inpatternand.Ar outpattern  ..Op Ar Inpatternis a template for incoming filenames (which may have already beenprocessed according to the.Ic ntransand.Ic casesettings).Variable templating is accomplished by including thesequences `$1', `$2', ..., `$9' in.Ar inpattern  .Use `\\' to prevent this special treatment of the `$' character.All other characters are treated literally, and are used to determine the.Ic nmap.Op Ar inpatternvariable values.For example, given.Ar inpattern$1.$2 and the remote file name "mydata.data", $1 would have the value"mydata", and $2 would have the value "data".The.Ar outpatterndetermines the resulting mapped filename.The sequences `$1', `$2', ...., `$9' are replaced by any value resultingfrom the.Ar inpatterntemplate.The sequence `$0' is replace by the original filename.Additionally, the sequence.Ql Op Ar seq1 , Ar seq2is replaced by.Op Ar seq1if.Ar seq1is not a null string; otherwise it is replaced by.Ar seq2 .For example, the command.Pp.Bd -literal -offset indent -compactnmap $1.$2.$3 [$1,$2].[$2,file].Ed.Ppwould yieldthe output filename "myfile.data" for input filenames "myfile.data" and"myfile.data.old", "myfile.file" for the input filename "myfile", and"myfile.myfile" for the input filename ".myfile".Spaces may be included in.Ar outpattern  ,as in the example: `nmap $1 sed "s/  *$//" > $1' .Use the `\e' character to prevent special treatmentof the `$','[','[', and `,' characters..It Ic ntrans Op Ar inchars Op Ar outcharsSet or unset the filename character translation mechanism.If no arguments are specified, the filename charactertranslation mechanism is unset.If arguments are specified, characters inremote filenames are translated during.Ic mputcommands and.Ic putcommands issued without a specified remote target filename.If arguments are specified, characters inlocal filenames are translated during.Ic mget

⌨️ 快捷键说明

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