First, pick up PSFTP (an SFTP client, i.e. general file transfer sessions much like FTP) from here.
Note the following:
6.2.7 The
cdandpwdcommands: changing the remote working directoryPSFTP maintains a notion of your ‘working directory’ on the server. This is the default directory that other commands will operate on. For example, if you type
get filename.datthen PSFTP will look forfilename.datin your remote working directory on the server.To change your remote working directory, use the
cdcommand. If you don’t provide an argument,cdwill return you to your home directory on the server (more precisely, the remote directory you were in at the start of the connection).To display your current remote working directory, type
pwd.6.2.8 The
lcdandlpwdcommands: changing the local working directoryAs well as having a working directory on the remote server, PSFTP also has a working directory on your local machine (just like any other Windows process). This is the default local directory that other commands will operate on. For example, if you type
get filename.datthen PSFTP will save the resulting file asfilename.datin your local working directory.To change your local working directory, use the
lcdcommand. To display your current local working directory, typelpwd.6.2.9 The
getcommand: fetch a file from the serverTo download a file from the server and store it on your local PC, you use the
getcommand.In its simplest form, you just use this with a file name:
get myfile.datIf you want to store the file locally under a different name, specify the local file name after the remote one:
get myfile.dat newname.datThis will fetch the file on the server called
myfile.dat, but will save it to your local machine under the namenewname.dat.To fetch an entire directory recursively, you can use the
-roption:
get -r mydir
get -r mydir newname(If you want to fetch a file whose name starts with a hyphen, you may have to use the
--special argument, which stopsgetfrom interpreting anything as a switch after it. For example, ‘get -- -silly-name-’.)
Here’s a useful page on the topic.
Hi,
The title is “Transfer Files Over PuTTY”, but you refer to the program FSFTP. Are the commands discussed in this blogentry the same for putty and FSFTP?
Thanks.
/Benny