Using SecureCRT in Linux to upload and download file commands sz and rz usage examples

Transfer: http://www.jb51.net/LINUXjishu/163820.html

Among them, for the understanding and memory of sz and rz, I used the following method (because it is easy to get confused):
The s in sz means send (send), telling the client that I (the server) want to send the file send to cilent , which is equivalent to the client downloading.
The r in rz means received, which tells the client that I (the server) want to receive the file received by cilent, which is equivalent to the client uploading.

Note: The sz and rz commands require server support. If the prompt does not have a command:


copy code
code show as below:

-bash: rz: command not found
-bash: sz: command not found



It can be installed with yum (Centos as an example):

 

copy code
code show as below:

yum install lrzsz -y

The following uses specific examples to illustrate the usage of sz and rz:

sz usage (running the command sz is much more convenient than the ftp command, and the server does not need to open another FTP service):

copy code
code show as below:

#Download a file
sz filename #Download
multiple files
sz filename1 filename2 #Download
all files in the dir directory, excluding the folders in
dir sz dir/*

The storage location of the downloaded file needs to be set in secureCRT, as shown in the figure below:



rz usage:

After entering rz and press Enter in the command terminal, a file selection dialog box will appear. Select the file to be uploaded. You can specify multiple files at a time. The path to upload to the server is the directory where the rz command is currently executed.



Note: There are two problems with rz alone: ​​upload interruption and upload file change (md5 is different). The solution is to use rz -be for uploading, and remove the check before "Upload files as ASCII" in the pop-up dialog box.
-b binary Upload and download in binary mode, do not interpret characters as ascii
-e Force escape all control characters, such as Ctrl+x, DEL, etc.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326929393&siteId=291194637