Home > System Tutorial > LINUX > body text

How to quickly interact with files on the local machine?

WBOY
Release: 2024-06-02 09:10:17
Original
739 people have browsed it

Generally speaking, remote login and remote login are mostly done through the client. After using ssh to log in to the Linux host, how can we quickly interact with the local machine for files, that is, upload and download files to the server and the local machine? ;

Two commands related to ssh can provide very convenient operations:

sz: Send the selected file to the local machine

rz: Running this command will pop up a file selection window, select files locally and upload them to the server (receive)

rz, sz is the command line tool for ZModem file transfer in Linux/Unix

The windows side needs to support ZModem’s telnet/ssh client (such as SecureCRT)

Run the command rz to receive the file. SecureCRT will pop up the file selection dialog box. After selecting the file, close the dialog box and the file will be uploaded to the current directory.

linux windows 文件传输_传输文件软件_传输文件网站

Note: Using rz alone will cause two problems: upload interruption and uploaded file changes (md5 is different) linux windows file transfer, the solution is to use rz-be for upload, but remove the pop-up dialog Check the box next to "UploadfilesasASCII".

-bbinary uploads and downloads in binary form, and does not interpret characters as ascii

-e forces escape of all control characters, such as Ctrl+x, DEL, etc.

Running the command szfile1file2 is to send files to Windows (the saving directory can be configured), which is much more convenient than the ftp command, but the server does not need to open the FTP service anymore

PS: Just install lrzsz-x.x.xx.rpm for the two small tools rz/sz on Linux.

In fact, you can also set the directory:

Set the default directory for uploading and downloading in SecureCRT

options–>sessionoptions–>The directory for uploading and downloading can be set under filetransfer

The rest you only need to use SecureCRT to log in to the Linux terminal:

Send file to client: szfilename

zmodem reception can be started by itself.

Upload files from client to linux server:

As long as the server executes:rz

After that, select the file to send in SecureCRT and contract zmodem

----------------

Introduction to the file transfer tool rz/sz (lrz/lsz) between Linux and Windows

【What is rz/sz(lsz/lrz)】

To put it simply, you can easily use these two sz/rz tools to realize file transfer (sending and receiving) between Linux and Windows. The rate is about 10KB/slinux. Setting environment variables is suitable for small and medium-sized files. rz/sz transfers data via Zmodem contract.

【Why use rz/sz】

Ordinary file sharing methods between Linux and Windows mainly include perfecting nfs to realize file sharing, and tftp and other methods, and they are very troublesome. If it is only a small file (tens of K, hundreds of K), then It becomes very convenient to use rz/sz directly. For large files, you still need to consider other sharing methods as mentioned above. Although the rz/sz rate is only about 10Klinux windows file transfer, it will be annoying to transfer large files. . .

【how to use】

(1) Under Windows, use SecureCRT (or the Hyper Terminal that comes with Windows) to connect the Com port to the development board, or use ssh or other contracts to connect to the Linux server.

(2) On the Linux side, after using the rz/sz (lrz/lsz) tool (during development, most of the compiled rz/sz tools have already been placed in rootfs. For ordinary Linux systems, if not, you can Download the linux restart command and install it yourself), you can run rz/sz directly to realize file transfer between Windows and Windows:

A. Copy/download files from Windows to Linux (development board):

linux windows 文件传输_传输文件网站_传输文件软件

After running rz, the file selection dialog box under WIndows will pop up manually. After selecting the corresponding file, add it, confirm it, and start the transfer, copying the files in Windows to Linux.

B. Copy the files in Linux to a folder in Windows:

Execute szfile_name to copy the file file_name in the current Linux folder to the corresponding directory in Windows. The Windows directory is set by the tool you are currently running.

I am using SecureCRT here. The specific way to modify the default path of rz upload/sz download:

Right-click on the current session session->SessionOptions->Terminal->Xmodem/Zmodem->Directories:

Upload:The path you want to set

Download:The path you want to set

The above is the detailed content of How to quickly interact with files on the local machine?. For more information, please follow other related articles on the PHP Chinese website!

source:itcool.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!