Forrest logo
back to the rsync tool


rsync: Transfer directory contents (but not the directory itself) from a remote host to local.
$ rsync -r ${remote_host}:${path-to-remote_directory}/ ${path-to-local_directory}
try on your machine

The command you provided is an example of how to use the rsync command to sync files between a remote host and a local directory.

Here's a breakdown of the command:

  • rsync: This is the command itself, used for remote file synchronization.
  • -r: This is an option that specifies recursive mode, allowing the command to sync the entire directory tree.
  • ${remote_host}: This is the hostname or IP address of the remote machine you want to sync files from.
  • ${path-to-remote_directory}: This is the path to the directory on the remote machine that you want to sync from. Make sure to replace ${path-to-remote_directory} with the actual directory path.
  • /: This forward slash is used to separate the hostname and the path on the remote machine. It means the subsequent path is relative to the root directory of the remote machine.
  • ${path-to-local_directory}: This is the path to the local directory where you want the files to be copied to. Replace ${path-to-local_directory} with the actual local directory path.

Putting it all together, the command tells rsync to recursively sync the contents of the ${path-to-remote_directory} on ${remote_host} to ${path-to-local_directory} on your local machine.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the rsync tool