In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use rz commands in Linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn how to use the rz command in Linux.
The rz command can upload files in batches, as well as individual files. The protocol used is the ancient ZMODEM protocol, although the protocol is old, but does not affect the easy-to-use features. In general, if we want to upload files to the Linux system, we either use ftp (we also have to set up a ftp server) or sftp. It takes a lot of commands to upload a file. For the rz command introduced here, simply tap the rz-be command on the command line, and a file selection box will pop up under SecureCRT to let you select the files you need to upload, and you can choose more than one; however, if you are using putty, there is nothing you can do.
Let's briefly talk about the ZModem protocol, starting with the XMODEM protocol (XMODEM Protocol). XMODEM protocol is an asynchronous file transport protocol widely used in personal computer communications using dial-up modems. This protocol transmits data in 128-byte blocks, and each block uses a checksum process for error detection. If the receiver's checksum for a block is the same as its checksum at the sender, the receiver sends an approved byte to the sender. However, this strategy of approving each block will lead to low performance, especially in the case of satellite connections with long propagation delays.
A protocol corresponding to XMODEM that uses cyclic redundancy checking is called XMODEM-CRC. The other is XMODEM-1K, which transmits data in 1024 bytes. YMODEM is also an implementation of XMODEM. It includes all the features of XMODEM-1K and adds a batch file transfer mode to send a set of files during a single session.
ZMODEM is the most effective version of XMODEM, and it doesn't need to be approved for every block. In fact, it simply requires a retransmission of the damaged block. ZMODEM is very useful for block-based packet-switched networks. There is no need to recognize echo packets, which greatly reduces traffic. It is an enhancement of the Xmodem file transfer protocol, which not only transmits larger data, but also has a lower error rate. Contains a feature called checkpoint restart that resumes transmission from the breakpoint rather than from the beginning if the communication link is interrupted during data transfer.
Search for Zmodem from the SecureCRT help topic and you will find the following instructions about Zmodem: Zmodem is a full-duplex file transfer protocol that supports fast data transfer rates and effective error detection. Zmodem is very user friendly, allowing either the sending or receiving party to initiate a file transfer. Zmodem supports multiple file ("batch") transfers, and allows the use of wildcards when specifying filenames. Zmodem also supports resuming most prior Zmodem file transfer attempts.
Corresponding to the rz command, the sz command enables you to download files from the Linux server locally.
Common parameters
-b is binary and defaults to text. (Binary (tell it like it is) file transfer override.)
-e escapes all control characters. Force sender to escape all control characters; normally XON, XOFF, DLE, CR-@-CR, and Ctrl-X are escaped.
If you want to ensure that the content of the uploaded file is consistent with the original file after it is saved on the server side, it is best to set these two flags at the same time, and use them as follows:
Rz-be
When this command is executed, a file selection dialog box will pop up. After selecting the files to be uploaded, click OK, and you can start the upload process. The speed of upload depends on the condition of the network at that time.
If a "0 error" is displayed at the end of the execution, the file upload is successful, and other displays indicate that there is a problem with the file upload.
Under some versions of Linux, execute the rz command to report "command not found", you can go to the installation disk to find lrzsz*.rpm to install.
Use the example
Example 1 upload the local jdk installer to the Linux server
The code is as follows:
[root@qzt196 setup] # rz-be
Rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
Transmitting jdk-6u21-linux-i586-rpm.bin...
77628 KB 137 KB/s 00:09:23 0 error
[root@qzt196 setup] # ls-l jdk-6u21-linux-i586-rpm.bin
-rw-r--r-- 1 root root 79491215 06-25 07:06 jdk-6u21-linux-i586-rpm.bin
[root@qzt196 setup] #
Example 2 upload the local ant installer to the Linux server
The code is as follows:
[root@qzt196 setup] # rz-be
Rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
Transmitting apache-ant-1.8.1-bin.tar.gz...
8071 KB 115 KB/s 00:01:10 0 error
[root@qzt196 setup] #
Example 3 cancel when you select a file
The code is as follows:
[root@qzt196 ~] # rz-be
Rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
[root@qzt196 ~] #
Example 4 Press Ctrl+C to terminate when uploading a file
The code is as follows:
[root@qzt196 ~] # rz-be
Rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
Transmitting apache-tomcat-5.5.31.tar.gz...
1 85 KB 10 KB/s 00:12:32 ETA 0 error
Rz: apache-tomcat-5.5.31.tar.gz removed.
[root@qzt196 ~] #
Example 5 upload multiple files at a time
The code is as follows:
[root@qzt196 ~] # rz-be
Rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
Transmitting applink.c...
100% 2 KB 2 KB/s 00:00:01 0 error
Transmitting arguments.cpp...
100% 2 KB 2 KB/s 00:00:01 0 error
Transmitting buffer.cpp...
100 bytes 825 bytes/s 00:00:01 0 error
Transmitting build...
100% 1 KB 1 KB/s 00:00:01 0 error
Transmitting bulk.cpp...
100% 2 KB 2 KB/s 00:00:01 0 error
At this point, I believe you have a deeper understanding of "the use of rz commands in Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.