From: jacob Date: Sat, 1 Jan 2005 16:16:13 +0000 (+0000) Subject: Document recent changes to PSFTP (and other documentation tweaks). X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/commitdiff_plain/c1b8799beabc6a0a7adb19c3d2437877af88b952 Document recent changes to PSFTP (and other documentation tweaks). git-svn-id: svn://svn.tartarus.org/sgt/putty@5058 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/doc/psftp.but b/doc/psftp.but index 5dc5d4e1..45980224 100644 --- a/doc/psftp.but +++ b/doc/psftp.but @@ -408,17 +408,17 @@ The \c{ls} command works exactly the same way as \c{dir}. \S{psftp-cmd-chmod} The \c{chmod} command: change permissions on remote files -PSFTP allows you to modify the file permissions on files on the -server. You do this using the \c{chmod} command, which works very -much like the Unix \c{chmod} command. +PSFTP allows you to modify the file permissions on files and +directories on the server. You do this using the \c{chmod} command, +which works very much like the Unix \c{chmod} command. The basic syntax is \c{chmod modes file}, where \c{modes} represents a modification to the file permissions, and \c{file} is the filename -to modify. For example: +to modify. You can specify multiple files or wildcards. For example: \c chmod go-rwx,u+w privatefile -\c chmod a+r publicfile -\c chmod 640 groupfile +\c chmod a+r public* +\c chmod 640 groupfile1 groupfile2 The \c{modes} parameter can be a set of octal digits in the Unix style. (If you don't know what this means, you probably don't want @@ -445,7 +445,8 @@ permissions for members of the owning group and everybody else (so the only permissions left are the ones for the file owner). \c{u+w} adds write permission for the file owner. -\b The second example: \c{a+r} adds read permission for everybody. +\b The second example: \c{a+r} adds read permission for everybody to +all files and directories starting with \q{public}. In addition to all this, there are a few extra special cases for Unix systems. On non-Unix systems these are unlikely to be useful: @@ -467,9 +468,18 @@ normally only the owner of the \e{directory} would be allowed to). \S{psftp-cmd-del} The \c{del} command: delete remote files -To delete a file on the server, type \c{del} and then the filename: +To delete a file on the server, type \c{del} and then the filename +or filenames: \c del oldfile.dat +\c del file1.txt file2.txt +\c del *.o + +Files will be deleted without further prompting, even if multiple files +are specified. + +\c{del} will only delete files. You cannot use it to delete +directories; use \c{rmdir} for that. The \c{rm} command works exactly the same way as \c{del}. @@ -480,26 +490,47 @@ directory name: \c mkdir newstuff +You can specify multiple directories to create at once: + +\c mkdir dir1 dir2 dir3 + \S{psftp-cmd-rmdir} The \c{rmdir} command: remove remote directories To remove a directory on the server, type \c{rmdir} and then the -directory name: +directory name or names: \c rmdir oldstuff +\c rmdir *.old ancient + +Directories will be deleted without further prompting, even if +multiple directories are specified. Most SFTP servers will probably refuse to remove a directory if the directory has anything in it, so you will need to delete the contents first. -\S{psftp-cmd-ren} The \c{ren} command: rename remote files +\S{psftp-cmd-mv} The \c{mv} command: move and rename remote files + +To rename a single file on the server, type \c{mv}, then the current +file name, and then the new file name: + +\c mv oldfile newname + +You can also move the file into a different directory and change the +name: + +\c mv oldfile dir/newname -To rename a file on the server, type \c{ren}, then the current file -name, and then the new file name: +To move one or more files into an existing subdirectory, specify the +files (using wildcards if desired), and then the destination +directory: -\c ren oldfile newname +\c mv file dir +\c mv file1 dir1/file2 dir2 +\c mv *.c *.h .. -The \c{rename} and \c{mv} commands work exactly the same way as -\c{ren}. +The \c{rename} and \c{ren} commands work exactly the same way as +\c{mv}. \S{psftp-cmd-pling} The \c{!} command: run a local Windows command diff --git a/psftp.c b/psftp.c index 71a8f274..54c3d793 100644 --- a/psftp.c +++ b/psftp.c @@ -1891,7 +1891,7 @@ static struct sftp_cmd_lookup { }, { "cd", TRUE, "change your remote working directory", - " [ ]\n" + " [ ]\n" " Change the remote working directory for your SFTP session.\n" " If a new working directory is not supplied, you will be\n" " returned to your home directory.\n", @@ -1899,10 +1899,11 @@ static struct sftp_cmd_lookup { }, { "chmod", TRUE, "change file permissions and modes", - " ( | ) \n" - " Change the file permissions on a file or directory.\n" - " can be any octal Unix permission specifier.\n" - " Alternatively, can include:\n" + " [ ... ]\n" + " Change the file permissions on one or more remote files or\n" + " directories.\n" + " can be any octal Unix permission specifier.\n" + " Alternatively, can include the following modifiers:\n" " u+r make file readable by owning user\n" " u+w make file writable by owning user\n" " u+x make file executable by owning user\n" @@ -1933,16 +1934,16 @@ static struct sftp_cmd_lookup { sftp_cmd_close }, { - "del", TRUE, "delete a file", - " \n" - " Delete a file.\n", + "del", TRUE, "delete files on the remote server", + " [ ... ]\n" + " Delete a file or files from the server.\n", sftp_cmd_rm }, { "delete", FALSE, "del", NULL, sftp_cmd_rm }, { - "dir", TRUE, "list contents of a remote directory", + "dir", TRUE, "list remote files", " [ ]/[ ]\n" " List the contents of a specified directory on the server.\n" " If is not given, the current working directory\n" @@ -1999,9 +2000,9 @@ static struct sftp_cmd_lookup { sftp_cmd_mget }, { - "mkdir", TRUE, "create a directory on the remote server", - " \n" - " Creates a directory with the given name on the server.\n", + "mkdir", TRUE, "create directories on the remote server", + " [ ... ]\n" + " Creates directories with the given names on the server.\n", sftp_cmd_mkdir }, { @@ -2014,18 +2015,22 @@ static struct sftp_cmd_lookup { sftp_cmd_mput }, { - "mv", TRUE, "move or rename a file on the remote server", - " \n" - " Moves or renames the file on the server,\n" - " so that it is accessible under the name .\n", + "mv", TRUE, "move or rename file(s) on the remote server", + " [ ... ] \n" + " Moves or renames (s) on the server to ,\n" + " also on the server.\n" + " If specifies an existing directory, then \n" + " may be a wildcard, and multiple s may be given; all\n" + " source files are moved into .\n" + " Otherwise, must specify a single file, which is moved\n" + " or renamed so that it is accessible under the name .\n", sftp_cmd_mv }, { "open", TRUE, "connect to a host", " [@] []\n" " Establishes an SFTP connection to a given host. Only usable\n" - " when you did not already specify a host name on the command\n" - " line.\n", + " when you are not already connected to a server.\n", sftp_cmd_open }, { @@ -2048,7 +2053,7 @@ static struct sftp_cmd_lookup { sftp_cmd_quit }, { - "reget", TRUE, "continue downloading a file", + "reget", TRUE, "continue downloading files", " [ -r ] [ -- ] [ ]\n" " Works exactly like the \"get\" command, but the local file\n" " must already exist. The download will begin at the end of the\n" @@ -2065,7 +2070,7 @@ static struct sftp_cmd_lookup { sftp_cmd_mv }, { - "reput", TRUE, "continue uploading a file", + "reput", TRUE, "continue uploading files", " [ -r ] [ -- ] [ ]\n" " Works exactly like the \"put\" command, but the remote file\n" " must already exist. The upload will begin at the end of the\n" @@ -2078,10 +2083,11 @@ static struct sftp_cmd_lookup { sftp_cmd_rm }, { - "rmdir", TRUE, "remove a directory on the remote server", - " \n" + "rmdir", TRUE, "remove directories on the remote server", + " [ ... ]\n" " Removes the directory with the given name on the server.\n" - " The directory will not be removed unless it is empty.\n", + " The directory will not be removed unless it is empty.\n" + " Wildcards may be used to specify multiple directories.\n", sftp_cmd_rmdir } };