The SCP command is for users to copy files from one Linux server to another Linux server over the network, as follows:
One: Copy from local to remote
To copy a file:
Command format: SCP local_file [Email Protected]_ip:remote_folder
Example:
Scp/home/space/music/1.mp3 [Email Protected]:/home/root/others/music
Scp/home/space/music/1.mp3 [Email Protected]:/home/root/others/music/001.mp3
Scp/home/space/music/1.mp3 Www.xxx.xxx.cn:/home/root/others/music
Scp/home/space/music/1.mp3 Www.xxx.xxx.cn:/home/root/others/music/001.mp3
To copy a directory:
Command format: scp-r local_folder [Email protected]_ip:remote_folder
or Scp-r Local_folder Remote_ip:remote_folder
Example:
Scp-r/home/space/music/[Email protected]:/home/root/others/
Scp-r/home/space/music/www.xxx.xxx.cn:/home/root/others/
The above command is to copy the local music directory to the remote others directory, which is available on the remote server after replication: /others/music/Directory
Two: From remote replication to local
From the remote copy to local, as long as the copy from the local to the remote command after the 2 parameters of the switch shun;
For example:
SCP [Email Protected]:/home/root/others/music/home/space/music/1.mp3
Scp-r www.xxx.xxx.cn:/home/root/others//home/space/music/
The use of the Linux SCP command to copy transfer files