rcp - macOS


rcp (remote copy) is a command-line utility for copying files between local and remote hosts. It supports both file transfer and directory recursion, making it effective for synchronization and backup tasks.


rcp [options] source-path destination-path



  • Recursively copy directories and their contents.


  • Preserve file attributes (permission, ownership, modification time).


  • Operate in verbose mode, displaying progress and detailed information.


  • Do not follow symbolic links (default behavior).


  • Preserve symbolic links, copying them as symbolic links.


  • Preserve hard links (default behavior).


  • Preserve soft links, copying them as soft links.


  • Do not overwrite existing files.


  • Implies -rlptvAH.


  • Copy only modification times.


Basic file transfer:

rcp ~/Documents/file.txt user@remote-host:/tmp/

Recursively copy directory:

rcp -r ~/Projects/ my-project/ user@remote-host:~/

Preserve attributes and follow symbolic links:

rcp -pvH ~/Documents/file.txt user@remote-host:/tmp/

Copy only modification times:

rcp -t ~/Documents/file.txt user@remote-host:/tmp/

Common Issues

  • Permission errors: Ensure you have sufficient permissions to access both the source and destination files/directories.
  • Connection issues: Verify network connectivity and the remote host’s SSH/FTP settings.
  • Destination file already exists: Use the -n option to prevent overwriting existing files.


rcp can be used with the following commands for advanced tasks:

  • rsync: Use rcp as a remote shell command for rsync, enabling efficient and incremental file transfers.
  • ssh: Integrate with SSH for secure file transfer over encrypted connections.
  • ftp: Utilize FTP for transferring files to/from remote FTP servers.
  • rsync: Advanced file transfer tool with features like incremental updates and bandwidth control.
  • scp: Secure file transfer utility that operates over SSH connections.
  • ftp: Command-line tool for transferring files via the File Transfer Protocol (FTP).