To use rz and sz commands to transfer files, you need to install lrzsz on the server:
yum -y install lrzsz
How to use the commands sz and rz
The r in rz means received. When rz is entered, it means that the server receives the file, and the official file is uploaded from the local to the server.
The s in sz means send. When sz is entered, it means that the server wants to send files, which means sending files from the server to the local, or downloading files locally from the server.
Note: Whether it is sent or received, the action is initiated on the server.
rz Usage:
Note: When uploading, if the uploaded Linux directory has a file with the same name, it will be difficult to upload. You need to delete the file with the same name on Linux first.
Enter rz and press Enter What is the linux command? The file selection dialog box linux format command will appear. Select the file to be uploaded. Multiple files can be specified at one time. Red flag linux6.0, the path uploaded to the server is the current execution rz The directory for the command. The file dialog box is as follows:
Multiple files can be selected.
sz Usage:
Download a file: szfilename
Download multiple files: szfilename1filename2
Download all files in the dir directory, excluding folders under dir: szdir/*
Using szfilename1fiename2 on xshell will pop up a dialog box What is the linux command? You can download it to the local folder you specify:
The reason why the dialog box pops up is because in the session property settings, "Always ask before downloading" is checked
If you use SecureCRT, the dialog box will not pop up because the SecureCRT session properties do not have the "Always ask before downloading" option to check:
The above is the detailed content of Detailed explanation on the installation and use of rz and sz commands to transfer files. For more information, please follow other related articles on the PHP Chinese website!