The destination may be specified either as [user @ host [: path] ] or as a URI in the form sftp:// [user @ host [: port [/ path] ] ]
If the destination includes a path and it is not a directory, sftp will retrieve files automatically if a non-interactive authentication method is used; otherwise it will do so after successful interactive authentication.
If no path is specified, or if the path is a directory, sftp will log in to the specified host and enter interactive command mode, changing to the remote directory if one was specified. An optional trailing slash can be used to force the path to be interpreted as a directory.
Since the destination formats use colon characters to delimit host names from path names or port numbers, IPv6 addresses must be enclosed in square brackets to avoid ambiguity.
The options are as follows:
A batchfile of `-' may be used to indicate standard input. sftp will abort if any of the following commands fail: get , put , reget , reput , rename , ln rm , mkdir , chdir , ls lchdir , copy , cp , chmod , chown chgrp , lpwd , df , symlink and lmkdir
Termination on error can be suppressed on a command by command basis by prefixing the command with a `-' character (for example, -rm /tmp/blah* ) Echo of the command may be suppressed by prefixing the command with a `@' character. These two prefixes may be combined in any order, for example -@ls /bsd
If the -h flag is specified, then symlinks will not be followed. Note that this is only supported by servers that implement the "lsetstat@openssh.com" extension.
If the -h flag is specified, then symlinks will not be followed. Note that this is only supported by servers that implement the "lsetstat@openssh.com" extension.
If the -h flag is specified, then symlinks will not be followed. Note that this is only supported by servers that implement the "lsetstat@openssh.com" extension.
Note that this is only supported by servers that implement the "copy-data" extension.
If the -a flag is specified, then attempt to resume partial transfers of existing files. Note that resumption assumes that any partial copy of the local file matches the remote copy. If the remote file contents differ from the partial local copy then the resultant file is likely to be corrupt.
If the -f flag is specified, then fsync(2) will be called after the file transfer has completed to flush the file to disk.
If the -p flag is specified, then full file permissions and access times are copied too.
If the -R flag is specified then directories will be copied recursively. Note that sftp does not follow symbolic links when performing recursive transfers.
The following flags are recognized and alter the behaviour of ls accordingly:
If the -a flag is specified, then attempt to resume partial transfers of existing files. Note that resumption assumes that any partial copy of the remote file matches the local copy. If the local file contents differ from the remote local copy then the resultant file is likely to be corrupt.
If the -f flag is specified, then a request will be sent to the server to call fsync(2) after the file has been transferred. Note that this is only supported by servers that implement the "fsync@openssh.com" extension.
If the -p flag is specified, then full file permissions and access times are copied too.
If the -R flag is specified then directories will be copied recursively. Note that sftp does not follow symbolic links when performing recursive transfers.