You can use the following commands in interactive sftp sessions and in sftp batch files.
Sets the current file transfer mode to ASCII. ASCII mode is useful for translating end-of-line characters. Use remote_newline and local_newline if you need to override the default handling of new lines. Supported values for remote_newline are 'DOS' (\r\n) and 'Unix' (\n). If no explicit value for the remote end-of-line convention is given, the remote host is queried to provide the convention. If the remote host does not support this functionality, the DOS end-of-line convention is assumed. The only supported value for local_newline is 'Unix' (\n). Use -s to display the current transfer mode.
Sets the transfer mode to 'auto'. In auto mode, the transfer method is determined by file extension. Files with specified file extensions use ASCII transfer; all other files use binary transfer. The default list of ASCII file types is "txt, htm*, pl, php*. To modify this list for a given sftp session, use the setext command. To change the default file extension list, use the client keyword FileCopyAsciiExtensions.
Sets the transfer mode to binary. In this mode, files transfer without any modification. Binary is the default transfer mode. This command is useful for turning off ASCII mode within a batch script.
This is a synonym for quit.
Changes the remote directory to directory.
Sets group ownership of files or directories specified by file to group. The group must be specified as a numeric group id (GID).
Sets file permissions for the files or directories specified by file. The mode must be specified in numeric format (for example, 664). Use -R to change files and directories recursively.
Sets the owner of the files or directories specified by file to owner. The owner must be specified as a numeric user id (UID).
Closes the connection to the remote server without exiting sftp.
Sets the debug level. Increasing the value increases the amount of information displayed. Use 1, 2, 3, or 99. (Values 4-98 are accepted, but are equivalent to 3.) Use either 'disable' or 'no' to disable debugging.
This is a synonym for ls.
This is a synonym for quit.
Copies the specified file or files to the current local working directory. (To copy to a different location, use lcd to change the local working directory.) If a file with the same name already exists, the existing file is overwritten. Wildcards are supported, but name substitution occurs on file names only, not directories. Use either --preserve or -p to preserve file attributes and time stamps.
Displays the current list of file extensions that use ASCII file transfer when auto mode is enabled. Use auto to enable auto mode. Use setext to change this list for the current session. Use the client keyword FileCopyAsciiExtensions to change the default list.
Displays sftp help. Use command to display help on the specified command.
Sets the local directory to directory.
Displays the local directory listing. The options are:
-1 (one column)
-a (show hidden files)
-f (do not sort)
-l (long list format)
-n (long list format with numeric user and group ids)
-r (reverse order)
-S (sort by size)
-t (sort by file access time)
-- (treat hyphens that follow as ordinary characters.)
Creates the specified local directory.
This is a synonym for symlink.
Displays the local working directory.
Displays the remote directory listing. The options are the same as for lls, and are described above.
This is a synonym for get.
Creates the specified remote directory.
This is a synonym for put.
Opens a connection to the specified host. Use -l to connect to the local host; in which case both local and remote commands act on files on the local file system.
Copies the specified file or files to the current remote working directory. (To copy to a different location, use cd to change the remote working directory.) If a file with the same name already exists, the existing file is overwritten. Wildcards are supported, but name substitution occurs on file names only, not directories. Use either --preserve or -p to preserve file attributes and time stamps.
Displays the remote working directory.
Exits sftp and closes the connection.
Renames a file from source to destination. No rename occurs if the destination file already exists.
Deletes the specified remote file or files. Wildcards are supported.
Deletes the specified remote directory.
Specifies the current list of file extensions that use ASCII file transfer when auto mode is enabled. To specify multiple extensions, use a comma or space-separated list; this command is not cumulative. Wildcard (zsh-glob) characters are supported. Don't precede file extensions with a period. To specify extensions containing spaces, use quotation marks around the extension or use a backslash as an escape character. Use auto to enable auto mode. Use getext to display the current list. Use the client keyword FileCopyAsciiExtensions to change the default list.
Creates a symbolic link (soft) from linked_path to target_path on the remote host.
Sets the debug level to verbose mode, which is equivalent to setting the debug level to 2. To disable verbose mode, use 'debug disable'.
Displays the supported SFTP protocol version.