Introduction to RZ, SZ commands and Mobaxterm

Introduction

Introduction to RZ and SZ commands

rz, sz are command-line tools for transferring ZModem files between Linux/Unix and Windows.

The Zmodem protocol is an error checking protocol for modem. Using the Zmodem protocol, data blocks of 512 bytes can be sent on the modem. If an error occurs in a data block, the receiving end will send a "NEC" response, so the data block will be retransmitted. It is an enhanced form of the Xmodem file transfer protocol, which not only can transfer larger data, but also has a lower error rate. Contains a feature called checkpoint restart that, if the communication link is interrupted in the middle of a data transfer, resumes the transfer from the point of interruption rather than from the beginning.

To install the rz and sz commands on Linux, the lrzsz package needs to be installed first. It can be installed with the following command:

  • For Ubuntu and Debian:

    sudo apt-get update
    sudo apt-get install lrzsz
    
  • For CentOS and Fedora:

    sudo yum install -y lrzsz  
    

Once installed, you can use the rz and sz commands for file transfers.

Instructions

SZ command

Send the selected files to the local machine. szThe command is to use the ZModem protocol to transfer files from the Linux server to the local, one or more files can be transferred at a time. Correspondingly, to upload files from the local to the Linux server, you can use rzthe command.

  • Common parameters:

    -a: Transfer as text (ascii).

    -b: Transmit in binary mode (binary).

    -e: Escape control characters (escape), which can ensure correct file transfer.

  • If you can be sure that the transferred file is in text format, use:sz -a files

  • For binary files, use:sz -be files

RZ command

Running this command will pop up a file selection window, select a file locally and upload it to the Linux server

Common parameters:

  • -b: In binary mode, the default is text mode. (Binary (tell it like it is) file transfer override.)
  • -e: Escapes all control characters.
  • If you want to ensure that the content of the uploaded file is consistent with the original file after being saved on the server side, it is best to set these two flags at the same time, as shown below:rz -be

When this command is executed, a file selection dialog box will pop up. After selecting the file to be uploaded, click OK to start the uploading process. The upload speed depends on the network conditions at the time.

If "0 error" is displayed after execution, the file upload is successful, and other displays indicate that there is a problem with the file upload.

Introduction to Mobaxterm

  1. Enter the path to the directory where you want to transfer the files in the Remote Path box.
  2. Click the Upload button and wait for the file transfer to complete.

Transfer files from remote server to local

  1. Start Mobaxterm and connect to the remote server.
  2. Select the "SFTP" tab in the left panel of Mobaxterm.
  3. In the SFTP Session window, select the Remote Files tab and browse for the file to transfer.
  4. Enter the path to the directory where you want to transfer the file in the Local Path box.
  5. Click the "Download" button and wait for the file transfer to complete.
  6. In the SFTP Session window, select the Local Files tab and browse for the file to transfer.
  7. Select the "SFTP" tab in the left panel of Mobaxterm.
  8. Start Mobaxterm and connect to the remote server.

Transfer files from local to remote server

Mobaxterm is a terminal and file transfer software that supports Windows and Linux. File transfer with Mobaxterm is very easy.

Change to SCP transfer when SFTP is not available

When your server does not support SFTP, you can change the session to use SCP to transfer data.

  1. Right click on your session → selectEdit session

    insert image description here

  2. Select AdvancedSSHsettingstab→SSH browser type and select SCP.

    insert image description here

When encountering the status of card master SFTP transmission card master being 0%, you can adjust this option to try to solve the problem.

Mobaxterm uses the RZ/SZ command

Mobaxterm does not support the rz and sz commands in the default downloaded version. will throw an error rz ▒z waiting to receive.**B0100000023be50(sz also).

In order to make Mobaxterm support Zmodem protocol, Mobaxterm adopts plug-in implementation.

  1. Now you can go to the official website to download the CygUtils.plugin and lrzsz plugins.

    MobaXterm

    insert image description here
    insert image description here
    insert image description here

  2. Put the downloaded plug-in in the installation directory of Mobaxterm.
    insert image description here

  3. At this time, we can right-click again to see the option to upload and download.

insert image description here

Summarize

This article introduces the rz and sz commands for file transfer between Linux/Unix and Windows, and the method of using Mobaxterm for file transfer. Also, how to use rz, sz commands in Mobaxterm and how to change session from SFTP to SCP transfer.

Guess you like

Origin blog.csdn.net/weixin_43645454/article/details/130264773