Copy copies of files in the same Linux system can be used with the CP command:
CP [Options] Source Dest
CP [options] source ... directory
Note: Copy one file to another file, or copy several files to another directory.
-A as far as possible file status, permissions and other information are reproduced as original.
-R If the source contains a directory name, the files under the directory are also copied to the destination.
-F If a destination already has a file with the same file name, it should be deleted before copying.
There are 3 common ways to copy files between different Linux:
The first is FTP, which is one of the Linux installation FTP Server, so you can use an FTP client program to copy files.
The second method is to use Samba services, similar to the Windows file copy method to operate, relatively simple and convenient.
The third is the use of SCP commands for File replication.
SCP is a file copy with security, SSH-based login. Easy to operate, such as to copy the current file to a remote other host
Copy from local to remote
Command format:
SCP Local_file [Email Protected]_ip:remote_folder
Or
SCP Local_file [Email protected]_ip:remote_file
Or
SCP Local_file Remote_ip:remote_folder
Or
SCP Local_file Remote_ip:remote_file
1th, 2 Specify the user name, command execution after the need to enter the password, the 1th only specifies the remote directory, the file name is unchanged, 2nd specified the file name;
3rd, 4 does not specify a user name, command execution after the need to enter a user name and password, the 3rd only specifies the remote directory, the file name is unchanged, 4th specified the file name;
From remote copy to local, as long as the copy from the local to the remote command of the following 2 parameter Exchange order;
Compared to the CP command, it is mainly in the source and dest before adding [email protected]_ip:, by adding the location of the difference between the end from remote to local or local to remote
Several parameters that may be useful:
-V is the same as-V in most Linux commands to show progress. Can be used to view connections, certifications, or configuration errors.
-C Enable compression option.
-P Select the port. Note-P has been used by RCP.
-4 forcibly use the IPV4 address.
-6 forcibly use the IPV6 address.
An explanation of the SCP Copy command under Linux