As everyone knows, SFTP is a file transfer protocol based on SSH. Compared with ZMODEM, it has a more secure and faster file transfer function. You can use the sftp command to transfer files from the local Xshell prompt. Let's learn the specific operation skills together.
Xshell software access address: http://www.xshellcn.com/xiazai.html
1. Use the following sftp command to connect to the server, the files will be transferred:
sftp [user@]host [port]
Example of command line)
Xshell> sftp myhostname
Xshell> sftp myusername@myhostname
Xshell> sftp myusername@myhostname 12345
2. The sftp prompt, the "help" command lists a set of available sftp commands:
sftp:/home/myusername> help |
|
bye |
finish your SFTP session |
cd |
change your remote working directory |
clear |
clear screen |
exit |
finish your SFTP session |
explore |
explore your local directory |
get |
download a file from the server to your local machine |
help |
give help |
lcd |
change and/or print local working directory |
lls |
list contents of a local directory |
lpwd |
print your local working directory |
ls |
list contents of a remote directory |
mkdir |
create a directory on the remote server |
mv |
move or rename a file on the remote server |
put |
upload a file from your local machine to the server |
pwd |
print your remote working directory |
quit |
finish your SFTP session |
rename |
move or rename a file on the remote server |
rm |
delete a file |
rmdir |
remove a directory on the remote server |
sftp:/home/myusername> |
3. The following is a sample operation for uploading a file:
1) Use the cd command to move to a directory where you want to upload the file. (server)
2) Use the "LCD" command to move the file to a directory, which will be uploaded and saved. (window)
3) Check the file name with "get" command.
4) Start uploading with the "put" command.
If Xftp is already installed, Xshell can create an Xftp session, making file transfers easier and more secure. As for how to use it, please refer to: How to open xftp in the current session of xshell?
The above tutorial is referenced from: http://www.xshellcn.com/zhishi/sftp-cs2.html