FTP are probably all used, SFTP used estimates are relatively few. Simply put, it is a secure before FTP, through the SSH channel between the local and remote server file transfer, more secure.
Connection
This is usually the case for SSH connections:
SSH sam@zfanw.com
then enter the password.
Sftp basically is to change ssh for SFTP:
SFTP sam@zfanw.com
If you have an SSH config file configured, it is simpler to connect to a remote server in the form of a private/public key:
SFTP Linode
When the connection is complete, the terminal displays:
SFTP >
Download files
The main function of FTP is file transfer, SFTP provides the download file command is get:
Get-r picture
This command downloads the picture directory to local.
Get Sam.png
This command downloads the sam.png picture to the local.
Where is the local??
We can use the LPWD command to view the local current working directory-that is, add an L to the PWD command to represent the locality. As you can see, we can also use the LCD to switch the local working directory.
Uploading files
The upload command provided by SFTP is put.
Put Sam.png
This command uploads the sam.png under the local current working directory to the working directory of the remote server.
Put-r picture
Upload the entire directory file.
More commands
All commands provided by SFTP can be viewed at SFTP > Terminal input Help:
Sftp> Help
Available commands:
Bye Quit sftp
CD path change remote directory to ' path '
CHGRP GRP Path Change group of file ' path ' to ' GRP '
chmod mode Path Change permissions of the file ' path ' to ' mode '
Chown own path change owner of file ' path ' to ' own '
DF [-hi] [path] Display statistics for current directory or
FileSystem containing ' path '
Exit Quit SFTP
Get [-PPR] remote [local] Download file
Help Display this help text
LCD path change local directory to ' path '
LLS [ls-options [path]] Display local directory listing
Lmkdir Path Create Local Directory
ln [-S] oldpath newpath Link remote file (-s for symlink)
LPWD Print Local working directory
LS [ -1afhlnrst] [path] Display remote directory listing
Lumask umask Set local umask to ' umask '
mkdir Path Create remote directory
Progress Toggle display of progress meter
Put [-PPR] local [remote] Upload file
PWD Display Remote working directory
Quit Quit SFTP
Rename oldpath newpath rename remote file
RM Path Delete Remote File
RmDir Path Remove remote directory
Symlink oldpath newpath symlink remote file
Version Show SFTP version
!command Execute ' command ' in the local shell
! Escape to the local shell
? Synonym for help