Linux rcp command
The Linux rcp command is used to copy remote files or directories.
The rcp command is used to copy files or directories on a remote system. If two or more files or directories are specified at the same time, and the final destination is an existing directory, it will copy all the previously specified files or directories to that directory.
Syntax
rcp [-pr][源文件或目录][目标文件或目录]
or
rcp [-pr][源文件或目录...][目标文件]
Options:
-p Preserve the attributes of source files or directories, including owner, group, permissions, and time.
-r Process recursively, handling files and subdirectories under the specified directory together.
Examples
Use the rcp command to copy remote files to the local system for saving.
Suppose the current account on the local host is rootlocal and the remote host account is root. To copy the file "testfile" from the remote host's (218.6.132.5) home directory to the local directory "test", 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: After the "rcp" command is executed, there will be no return message. You only need to check whether the file "testfile" exists in the directory "test". If it exists, the remote copy operation was successful; otherwise, the remote copy operation failed.
Other Extensions
Linux Command Reference