Transferring Files to Your Computer

The rsync command isn't just for copying files from your local machine to a remote host. You can also transfer files from a remote machine to your local host by placing the remote host and remote source path as the first argument on the command line. Therefore, to transfer src_dir on host to dest_dir on the local host, run this command:

rsync -a host:src_dir dest_dir

Note

If you omit host:, you can use rsync for making duplicates of directories on your local machine.

Get How Linux Works now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.