Sent username "fred"
Remote working directory is /home/fred
Listing directory /home/fred/lib
drwxrwsr-x 4 fred fred 1024 Sep 6 10:42 .
drwxr-sr-x 25 fred fred 2048 Dec 14 09:36 ..
drwxrwsr-x 3 fred fred 1024 Apr 17 2000 jed
lrwxrwxrwx 1 fred fred 24 Apr 17 2000 timber
drwxrwsr-x 2 fred fred 1024 Mar 13 2000 trn
you might see this:
C:\>psftp fred@hostname -bc -b batchfile
Sent username "fred"
Remote working directory is /home/fred
psftp> dir lib
Listing directory /home/fred/lib
drwxrwsr-x 4 fred fred 1024 Sep 6 10:42 .
drwxr-sr-x 25 fred fred 2048 Dec 14 09:36 ..
drwxrwsr-x 3 fred fred 1024 Apr 17 2000 jed
lrwxrwxrwx 1 fred fred 24 Apr 17 2000 timber
drwxrwsr-x 2 fred fred 1024 Mar 13 2000 trn
psftp> quit
6.1.3 -be: continue batch processing on errors
When running a batch file, this additional option causes PSFTP to continue processing even if a command fails to complete successfully.
You might want this to happen if you wanted to delete a file and didn't care if it was already not present, for example.
6.1.4 -batch: avoid interactive prompts
If you use the -batch option, PSFTP will never give an interactive prompt while establishing the connection. If the server's host key is invalid, for example (see
section 2.2
), then the connection will simply be abandoned instead of asking you what to do next.
This may help PSFTP's behaviour when it is used in automated scripts: using -batch, if something goes wrong at connection time, the batch job will fail rather than hang.
6.2 Running PSFTP
Once you have started your PSFTP session, you will see a psftp> prompt. You can now type commands to perform file-transfer functions. This section lists all the available commands.
Any line starting with a # will be treated as a comment and ignored.
•
6.2.1 General quoting rules for PSFTP commands
•
6.2.2 Wildcards in PSFTP
•
6.2.3 The open command: start a session
•
6.2.4 The quit command: end your session
•
6.2.5 The close command: close your connection
•
6.2.6 The help command: get quick online help
•
6.2.7 The cd and pwd commands: changing the remote working directory
•
6.2.8 The lcd and lpwd commands: changing the local working directory
•
6.2.9 The get command: fetch a file from the server
•
6.2.10 The put command: send a file to the server
•
6.2.11 The mget and mput commands: fetch or send multiple files
•
6.2.12 The reget and reput commands: resuming file transfers
•
6.2.13 The dir command: list remote files
•
6.2.14 The chmod command: change permissions on remote files
•
6.2.15 The del command: delete remote files