English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux Reference Manual

Linux Command大全

Linux rcp command

Linux rcp command is used to copy remote files or directories.

The rcp command is used to copy files or directories from a remote host. If more than two files or directories are specified and the last destination is an existing directory, it will copy all the specified files or directories to that directory.

or-Syntax

pr][Source file or directory][Target file or directory]

or-rcp [

pr][Source file or directory...][Target file]Parameters

-:

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

r Recursively process the specified directory and its subdirectories.

Online Examples

Set the local host account to rootlocal and the remote host account to root. To save the remote file to the local, use the rcp command.218.6.132.5If you want to copy the file "testfile" under the main directory to the local directory "test", enter the following command:

rcp [email protected]:./testfile testfile  # Copy the remote file to the local  
rcp [email protected]:home/rootlocal/testfile testfile  
# The current login account cmd logs in to the remote host  
rcp 218.6.132.5:./testfile testfile

Note: After executing the instruction "rcp", there will be no return information. You only need to check if the file "testfile" exists in the directory "test". If it exists, it means that the remote copy operation was successful; otherwise, the remote copy operation failed.

Linux Command大全