Linux and windows file transfer details and examples

  • 2020-05-27 07:59:32
  • OfStack

There are many ways to transfer files between Linux systems, and this blog describes two of them. It is often used in the development process.

In general, individuals often use the rz or sz commands to upload and download files.

rz sz upload download

It is easy to install rz, sz.


yum install lrzsz

After installation, you can perform basic upload and download operations:

Perform rz via SecureCRT for upload.


[root@iZ25ltqcjzrZ ~]# rz

A window will pop up, select upload file, and wait for completion. Of course, rz also has some parameters, such as 1:


rz -bey

scp transfer files

Due to security concerns of some servers, rz software is not allowed to be installed, so we have to use scp for transmission. The operating command for scp is actually quite simple.

Transfer the local file to the specified path of the target server:


#  Copying files 
$scp local_file remote_username@remote_ip:remote_folder
#  Directory replication 
$scp -r local_folder remote_username@remote_ip:remote_folder

Where local_file is the local file, remote_username target server login name, remote_ip target server password, remote_folder target server target path.

Send the remote file cp locally:


$scp remote_username@remote_ip:remote_file local_folder

Compare 1 from local cp to remote server, just switch the target and source once.

SFTP

SecureCRT can enter sftp connection mode through the shortcut key Alt+p.

The download file


sftp>get  Absolute file path 

View the download to the local path to get the download to the local path


sftp>lpwd

Upload file:


sftp>put  The absolute path to the local file 

Thank you for reading, I hope to help you, thank you for your support of this site!


Related articles: