Linux command
rcp 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Example
rcp path/to/local_file username@remote_host:/path/to/destination/
Example
rcp -r path/to/local_directory username@remote_host:/path/to/destination/
Preserve
rcp -p path/to/local_file username@remote_host:/path/to/destination/
Force
rcp -f path/to/local_file username@remote_host:/path/to/destination/
说明
rcp copies files between local and remote systems. It mimics the behavior of the cp command but operates across different machines using the RSH protocol. The source or destination can be specified as user@host:path for remote locations.
参数
- -r, --recursive
- Copy directories recursively
- -p, --preserve
- Preserve file attributes (mode, ownership, timestamps)
- -f, --from
- Force copy without confirmation
FAQ
What is the rcp command used for?
rcp copies files between local and remote systems. It mimics the behavior of the cp command but operates across different machines using the RSH protocol. The source or destination can be specified as user@host:path for remote locations.
How do I run a basic rcp example?
Run `rcp path/to/local_file username@remote_host:/path/to/destination/` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -r, --recursive do in rcp?
Copy directories recursively