System Administration Guide: Security Services

How to Transfer Files Remotely With the sftp Command

The sftp command works similarly to ftp, but uses a different set of subcommands. The following table lists some representative subcommands.

Table 11–3 Interactive sftp Subcommands
 Category

Subcommands 

Description 

Navigation 

cd path,

Changes the remote directory to path

lcd path

Changes the local directory to path

Ownership 

chgrp group file

Changes the group for file to group, a numeric GID

chmod mode file

Changes the permissions of file

File copying 

get remote_file [local-path]

Retrieves a remote file and stores the file on the local host 

put local_file [remote_path]

Stores a local file on the remote host 

rename old_filenew_file

Renames a local file 

Directory listing 

ls [path]

Lists the contents of the remote directory 

Directory creation 

mkdir path

Creates a remote directory 

Miscellaneous 

exit, quit

Quits the sftp command