Latest web development tutorials

Linux rcp command

Linux command Daquan Linux command Daquan

Linux rcp command to copy the remote file or directory.

rcp command with the distal end of copying files or directories, such as specifying two or more files or directories, and the final destination is an existing directory, it will copy all previously specified files or directories to the directory .

grammar

rcp [-pr][源文件或目录][目标文件或目录]

or

rcp [-pr][源文件或目录...][目标文件]

Parameters:

-p keep the source file or directory attributes, including the owner, owning group, permissions, and time.

-r recursive processing, the files and subdirectories in the specified directory be dealt with.

Examples

Use rcp command to copy a remote file to a local save.

Let the local host for the current account rootlocal, the remote host account for the root, the file to the remote host (218.6.132.5) home directory "testfile" copy to the local directory "test", then enter the following command:

rcp [email protected]:./testfile testfile  #复制远程文件到本地  
rcp [email protected]:home/rootlocal/testfile testfile  
#要求当前登录账户cmd 登录到远程主机  
rcp 218.6.132.5:./testfile testfile

Note: The command "rcp" will not return after the implementation of information, you need only to check whether the file "testfile" in the directory "test". If present, it indicates that the remote copy operation is successful, otherwise the remote copy operation fails.

Linux command Daquan Linux command Daquan