How to use SecureCRT to upload and download files in Linux system?

        In the process of using linux, whether it is to install related software or other purposes, we may need to upload or download files on linux. With securtCRT, using the linux command sz can easily download files on the server to the local, and using the rz command is to upload local files to the server.

        Among them, for the understanding and memory of sz and rz, I used the following methods (it is often easy to confuse):

        The s in sz means send (send), telling the client that I (the server) want to send the file send to cilent, which is equivalent to the client downloading.

        The r in rz means received (received), telling the client that I (the server) want to receive the file received by cilent, which is equivalent to the client uploading.

        Remember that, whether it is send or received, the action is initiated on the server. We are accustomed to saying upload or download, in fact, it is not necessary. Using these two commands, just think about whether to send the file from the server or receive it back from the client.

        If you want to upload the file from the client to the server, the server will receive the file back, the logic is: I (client) upload, you (server) receive, use rz.

        If you want to download the file from the server back (to the client), the server sends the file. The logic is: I download (client), you (server) send, use sz.

        Finally summed up in one sentence:

        I (client) upload, you (server) receive (RZ), I download (client), you (server) send (SZ).

 

1. To upload or download, you need to use the rz and sz commands. If these two command tools are not available on linux, you need to install them first. It can be installed using yum. Run the command yum install lrzsz.



2. After the installation is complete, you can use the rz command to upload local files to the linux platform. Run the rz command, and a dialog box for selecting a file will pop up.

        If the upload interface does not appear, you can click it.



3. Select the folder where the file to be uploaded is located, and then click File. Then click the Add button, and the files to be uploaded will be displayed in the "Send Files" box. Click the OK button to complete the upload.



        rz usage: After entering rz and press Enter, a file selection dialog box will appear, select the file to be uploaded, multiple files can be specified at a time, and the path to upload to the server is the directory where the rz command is currently executed.

        Note: There are two problems with rz alone: ​​upload interruption and upload file change (md5 is different). The solution is to use rz -be for uploading, and remove the check before "Upload files as ASCII" in the pop-up dialog box.


        -b binary Upload and download in binary mode, do not interpret characters as ascii;

        -e Force escape (escape) all control characters, such as Ctrl+x, DEL, etc.;

        -y Overwrite if a file with the same name exists.

        More parameters can be viewed by running rz --help, as follows:


 

4. If you need to download files on linux, use the sz command. sz plus the full path of the file, for example: sz install.log. This will download to a local default folder.

sz usage:

        Download a file: sz filename 

        Download multiple files: sz filename1 filename2

        Download all files in dir directory, excluding folders in dir: sz dir/*

The download file storage location is set in secureCRT, located at:

        English version options — session options — X/Y/Zmodem.

        Chinese Version Options - Session Options - X/Y/Zmodem.

 

5. When using sz to upload, the selection box will be opened in advance in a default directory. When using sz to download, it will also download to a default directory. This default directory can be set.

 

6. You need to set the default directory for uploading and downloading, click the option in the menu bar of SecureCRT = "session option. Open the Session Options dialog box, click Terminal = "X/Y/Zmodem in the category.




7.在对话框的右边有设置目录,这个就是上传和下载的默认的目录。修改成需要的目录后,点击确定即可。



注意事项:上传的时候,如果上传到的linux目录有同名的文件,是无法上传的,需要先删掉linux上的同名文件。

 

文章来源:http://www.jb51.net/LINUXjishu/311274.html

http://blog.csdn.net/lioncode/article/details/7921525

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326632892&siteId=291194637