Online Linux Terminal Logo
OnlineLinuxTerminal
Networking & TransferCLI Reference

$rsync

Fast and versatile remote and local file-copying and synchronization tool.

Syntax DefinitionPOSIX standard
rsync [OPTIONS] SOURCE... DEST
Linux Community2.4k Online

Chat with real Linux users, learn new commands & get free cheat sheet PDFs.

Try `rsync` Live in Interactive Sandbox

Zero-install client simulation with real-time feedback.

Open in Fullscreen Workspace↗
bash — terminal

Overview & How rsync Works

`rsync` (Remote Sync) synchronizes files and directories between two locations with delta-transfer algorithm, minimizing data transfer by sending only the differences between files.

Common Flags & Command Options

Flag / OptionDescription
-a, --archiveArchive mode (preserves permissions, timestamps, symlinks, owners, groups).
-v, --verboseIncrease verbosity showing transferred files.
-z, --compressCompress file data during transfer.
--deleteDelete extraneous files from destination directories that no longer exist in source.

Practical Real-World Examples

Example #1Synchronize local directory with remote backup
rsync -avz /home/user/projects/ user@backup-server:/backups/projects/

Transfers and synchronizes project folder with compression and archive preservation.

Frequently Asked Questions

What is the trailing slash difference in rsync source paths?

`rsync -a src/ dst/` copies the *contents* of `src` into `dst`, whereas `rsync -a src dst/` creates the folder `dst/src`.