[Linux] The local and server files are uploaded and downloaded, Linux server files are uploaded and downloaded, and linux Files are uploaded.
I. File Transfer in Linux and scp command instance
1. Directory replication in Linux: Local> Remote Server
Scp-r/home/abc/test1 root@192.168.0.1:/home/bcd/test2
(Local directory path remote machine username @ IP:/directory)
2. Directory replication in Linux: Remote Server-> Local Machine
Scp-r root@192.168.0.1:/home/bcd/test2/home/abc/test1
(Remote machine username @ IP:/directory local directory path)
3. Copy files in Linux: Remote Server-> Local Machine
Scp-P 22 root@192.168.0.1:/home/1.txt/home/1.txt
Note: If the port number is changed, enter "-P" after "scp" (note that "-p" is in upper case and "-P" is in lower case in ssh commands)
Ii. Mutual transfer between Windows and Linux, pscp command instance
(Note: There are many methods. Here we will introduce the pscp command)
Premise: Download pscp.exe and set the path environment variable.
Cmd command:
Upload:
pscp d:\upload.txt username@192.168.1.1:/home/username/upload/upload.txt
Download:
pscp root@192.168.1.1:/home/username/download/download.txt d:\download.txt