When we use Xshell to connect Linux hosts on Windows, we need to transfer files to a Linux host or obtain files from a Linux host, the RZ and SZ commands can be used, and the benefits of RZ and SZ are simple and convenient as long as the file transfer is enabled by the terminal Input command.
RZ: Run this command, the Linux host receives the file, relative to the Windows host is to the Linux host to transfer files.
SZ: Run this command, the Linux host sends the file, relative to the Windows host is from the Linux host obtains the file, the SZ command then sends the file.
Of course, RZ and SZ are not installed on Linux by default, here we use CentOS to demonstrate how to install and use RZ and Sz.
- Use Yum to search for the installation package name for RZ and SZ commands
The lrzsz.x86_64 that appear after the split line is the installation package we need.
- Execute #yum-y Install lrzsz.x86_64, installation complete. (using Yum requires a networked environment, and the-y option means that all queries during installation are automatically answered with Yes)
- At this point, RZ and SZ can be used.
RZ: In the terminal under the input RZ, you can pop up the Windows dialog box, we may choose to upload the file.
SZ: Enter SZ file under Terminal, also Pop up Windows dialog box, we can choose where to get the file on Windows.
Use RZ, sz command to transfer files between Windows host and Linux host