With securtCRT, the linux command sz can easily download files from the server to the local device. The rz command uploads local files to the server.
Here, I use the following methods for understanding and memorizing sz and rz (because it is often easy to mix up ):
In sz, "s" means "send" and tells the client that "I (server)" wants to send the file "send to cilent", which is equivalent to "download" on the client.
The r in rz indicates received, and tells the client that the client is uploading the received ed by cilent file.
Note: The sz and rz commands must be supported by the server. If no command is prompted:
Copy codeThe code is as follows:
-Bash: rz: command not found
-Bash: sz: command not found
You can use yum for installation (Centos as an example ):
Copy codeThe code is as follows:
Yum install lrzsz-y
The following describes the usage of sz and rz:
Sz usage (it is much easier to run the command sz than the ftp command, and the server does not need to enable another FTP service ):
Copy codeThe code is as follows:
# Download an object
Sz filename
# Download multiple files
Sz filename1 filename2
# Download all files in the dir Directory, excluding folders in the dir Directory
Sz dir /*
The location where the downloaded file is stored must be set in securtCRT. The settings are as follows:
Rz usage:
Enter rz in the command terminal and press Enter. the file selection dialog box appears. select the file to be uploaded. multiple files can be specified at a time. the path uploaded to the server is the directory where the rz Command is currently executed.
Note: If you use rz separately, there will be two problems: the upload is interrupted, and the Upload file changes (md5 is different). The solution is to use rz-be for uploading, remove the check box before "Upload files as ASCII" in the pop-up dialog box.
-B binary files are uploaded and downloaded in binary format. the characters are not interpreted as ascii.
-E forces escape to control all characters, such as Ctrl + x and DEL.