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

📄 psftp.but

📁 大名鼎鼎的远程登录软件putty的Symbian版源码
💻 BUT
📖 第 1 页 / 共 2 页
字号:
\versionid $Id: psftp.but,v 1.1.1.1.10.1 2004/12/29 11:32:21 pekangas Exp $\C{psftp} Using PSFTP to transfer files securely\i{PSFTP}, the PuTTY SFTP client, is a tool for transferring filessecurely between computers using an SSH connection.PSFTP differs from PSCP in the following ways:\b PSCP should work on virtually every SSH server. PSFTP uses thenew SFTP protocol, which is a feature of SSH 2 only. (PSCP will alsouse this protocol if it can, but there is an SSH 1 equivalent it canfall back to if it cannot.)\b PSFTP allows you to run an interactive file transfer session,much like the Windows \c{ftp} program. You can list the contents ofdirectories, browse around the file system, issue multiple \c{get}and \c{put} commands, and eventually log out. By contrast, PSCP isdesigned to do a single file transfer operation and immediatelyterminate.\H{psftp-starting} Starting PSFTPThe usual way to start PSFTP is from a command prompt, much likePSCP. To do this, it will need either to be on your \i{\c{PATH}} orin your current directory.  To add the directory containing PSFTP toyour \c{PATH} environment variable, type into the console window:\c set PATH=C:\path\to\putty\directory;%PATH%Unlike PSCP, however, PSFTP has no complex command-line syntax; youjust specify a host name and perhaps a user name:\c psftp server.example.comor perhaps\c psftp fred@server.example.comAlternatively, if you just type \c{psftp} on its own (ordouble-click the PSFTP icon in the Windows GUI), you will see thePSFTP prompt, and a message telling you PSFTP has not connected toany server:\c C:\>psftp\c psftp: no hostname specified; use "open host.name" to connect\c psftp>At this point you can type \c{open server.example.com} or \c{openfred@server.example.com} to start a session.PSFTP accepts all the general command line options supported by thePuTTY tools, except the ones which make no sense in a file transferutility. See \k{using-general-opts} for a description of theseoptions. (The ones not supported by PSFTP are clearly marked.)PSFTP also supports some of its own options. The following sectionsdescribe PSFTP's specific command-line options.\S{psftp-option-b} \c{-b}: specify a file containing batch commandsIn normal operation, PSFTP is an interactive program which displaysa command line and accepts commands from the keyboard.If you need to do automated tasks with PSFTP, you would probablyprefer to specify a set of commands in advance and have themexecuted automatically. The \c{-b} option allows you to do this. Youuse it with a file name containing batch commands. For example, youmight create a file called \c{myscript.scr} containing lines likethis:\c cd /home/ftp/users/jeff\c del jam-old.tar.gz\c ren jam.tar.gz jam-old.tar.gz\c put jam.tar.gz\c chmod a+r jam.tar.gz\c quitand then you could run the script by typing\c psftp user@hostname -b myscript.scrWhen you run a batch script in this way, PSFTP will abort the scriptif any command fails to complete successfully. To change thisbehaviour, you can use the \c{-be} option (\k{psftp-option-be}).\S{psftp-option-bc} \c{-bc}: display batch commands as they are runThe \c{-bc} option alters what PSFTP displays while processing abatch script. With the \c{-bc} option, PSFTP will display promptsand commands just as if the commands had been typed at the keyboard.So instead of seeing this:\c Sent username "fred"\c Remote working directory is /home/fred\c Listing directory /home/fred/lib\c drwxrwsr-x    4 fred     fred         1024 Sep  6 10:42 .\c drwxr-sr-x   25 fred     fred         2048 Dec 14 09:36 ..\c drwxrwsr-x    3 fred     fred         1024 Apr 17  2000 jed\c lrwxrwxrwx    1 fred     fred           24 Apr 17  2000 timber\c drwxrwsr-x    2 fred     fred         1024 Mar 13  2000 trnyou might see this:\c Sent username "fred"\c Remote working directory is /home/fred\c psftp> dir lib\c Listing directory /home/fred/lib\c drwxrwsr-x    4 fred     fred         1024 Sep  6 10:42 .\c drwxr-sr-x   25 fred     fred         2048 Dec 14 09:36 ..\c drwxrwsr-x    3 fred     fred         1024 Apr 17  2000 jed\c lrwxrwxrwx    1 fred     fred           24 Apr 17  2000 timber\c drwxrwsr-x    2 fred     fred         1024 Mar 13  2000 trn\c psftp> quit\S{psftp-option-be} \c{-be}: continue batch processing on errorsWhen running a batch file, this option causes PSFTP to continueprocessing even if a command fails to complete successfully.You might want this to happen if you wanted to delete a file anddidn't care if it was already not present, for example.\S{psftp-usage-options-batch}\c{-batch}: avoid interactive promptsIf you use the \c{-batch} option, PSFTP will never give aninteractive prompt while establishing the connection. If theserver's host key is invalid, for example (see \k{gs-hostkey}), thenthe connection will simply be abandoned instead of asking you whatto do next.This may help PSFTP's behaviour when it is used in automatedscripts: using \c{-batch}, if something goes wrong at connectiontime, the batch job will fail rather than hang.\H{psftp-commands} Running PSFTPOnce you have started your PSFTP session, you will see a \c{psftp>}prompt. You can now type commands to perform file-transferfunctions. This section lists all the available commands.\S{psftp-quoting} General quoting rules for PSFTP commandsMost PSFTP commands are considered by the PSFTP command interpreteras a sequence of words, separated by spaces. For example, thecommand \c{ren oldfilename newfilename} splits up into three words:\c{ren} (the command name), \c{oldfilename} (the name of the file tobe renamed), and \c{newfilename} (the new name to give the file).Sometimes you will need to specify file names that \e{contain}spaces. In order to do this, you can surround the file name withdouble quotes. This works equally well for local file names andremote file names:\c psftp> get "spacey file name.txt" "save it under this name.txt"The double quotes themselves will not appear as part of the filenames; they are removed by PSFTP and their only effect is to stopthe spaces inside them from acting as word separators.If you need to \e{use} a double quote (on some types of remotesystem, such as Unix, you are allowed to use double quotes in filenames), you can do this by doubling it. This works both inside andoutside double quotes. For example, this command\c psftp> ren ""this"" "a file with ""quotes"" in it"will take a file whose current name is \c{"this"} (with a doublequote character at the beginning and the end) and rename it to afile whose name is \c{a file with "quotes" in it}.(The one exception to the PSFTP quoting rules is the \c{!} command,which passes its command line straight to Windows without splittingit up into words at all. See \k{psftp-cmd-pling}.)\S{psftp-cmd-open} The \c{open} command: start a sessionIf you started PSFTP by double-clicking in the GUI, or just bytyping \c{psftp} at the command line, you will need to open aconnection to an SFTP server before you can issue any othercommands (except \c{help} and \c{quit}).To create a connection, type \c{open host.name}, or if you need tospecify a user name as well you can type \c{open user@host.name}.Once you have issued this command, you will not be able to issue itagain, \e{even} if the command fails (for example, if you mistypethe host name or the connection times out). So if the connection isnot opened successfully, PSFTP will terminate immediately.\S{psftp-cmd-quit} The \c{quit} command: end your sessionWhen you have finished your session, type the command \c{quit} toterminate PSFTP and return to the command line (or just close thePSFTP console window if you started it from the GUI).You can also use the \c{bye} and \c{exit} commands, which haveexactly the same effect.\S{psftp-cmd-help} The \c{help} command: get quick online helpIf you type \c{help}, PSFTP will give a short list of the availablecommands.If you type \c{help} with a command name - for example, \c{help get}- then PSFTP will give a short piece of help on that particularcommand.\S{psftp-cmd-cd} The \c{cd} and \c{pwd} commands: changing theremote working directoryPSFTP maintains a notion of your \q{working directory} on theserver. This is the default directory that other commands willoperate on. For example, if you type \c{get filename.dat} then PSFTPwill look for \c{filename.dat} in your remote working directory onthe server.To change your remote working directory, use the \c{cd} command. Ifyou don't provide an argument, \c{cd} will return you to your homedirectory on the server (more precisely, the remote directory you werein at the start of the connection).

⌨️ 快捷键说明

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