rsync Flag Explainer
Paste any rsync command and get a per-flag breakdown of what it does.
Client-side only — nothing leaves your browser
Source
/src/
Destination
user@host:/dst/
This command contains destructive flags: --delete
Always test with --dry-run (-n) first. A wrong source or trailing slash can wipe files on the destination.
| Flag | Long Form | Meaning |
|---|---|---|
-a | --archive | Archive mode — equivalent to -rlptgoD. Recursively copies files while preserving symlinks, permissions, modification times, group, owner, and device/special files. |
-v | --verbose | Verbose output. Use -vv or -vvv for increasing detail. Shows files as they are transferred. |
-z | --compress | Compress file data during transfer. Useful over slow networks; usually unnecessary on fast LANs or when files are already compressed. |
-P | Shortcut for --partial --progress. Keeps partially transferred files on interrupt and shows a per-file progress bar. | |
--deleteRisky | Delete files on the destination that no longer exist on the source. Makes the destination an exact mirror — files removed from the source are erased on the destination. | |
--exclude | Exclude files matching the given pattern (e.g. --exclude=node_modules or --exclude='*.log'). Can be specified multiple times. |
What does the rsync command do?
rsync ("remote sync") is a Unix utility that efficiently transfers and synchronizes files between two locations — locally, between two machines, or to and from a remote server over SSH. Its claim to fame is the delta-transfer algorithm: rsync only sends the parts of a file that have changed, which makes incremental backups and large-tree mirroring dramatically faster than tools like scp or cp. The catch is that rsync's behavior is controlled almost entirely by its flags, and a single missing or misplaced flag can mean copying the wrong files, blowing away the wrong directory, or silently dropping permissions.
Most Common rsync Flag Combinations
Most real-world rsync commands you will see in scripts, tutorials, and Stack Overflow answers fall into a handful of patterns:
| Combination | What it does |
|---|---|
| -a | Archive — recursive + preserve everything (perms, times, owner, group, symlinks, devices). |
| -av | Archive with verbose output. Most common starting point. |
| -avz | Archive, verbose, compress in transit. Standard for SSH transfers over the internet. |
| -avzP | Adds --partial --progress for resumable transfers with a progress bar. |
| -avh | Archive, verbose, human-readable file sizes. |
| -avn | Archive verbose dry-run — see what would happen without doing it. |
| -av --delete | Mirror mode — destination becomes an exact copy of source, including deletions. |
Risky rsync Flags to Watch For
These flags can permanently delete data. Always pair them with --dry-run (-n) the first time you run a command:
| Flag | Risk |
|---|---|
| --delete | Erases anything on the destination that isn't in the source. A wrong source path can empty an entire directory. |
| --delete-excluded | Also deletes files that match your --exclude patterns from the destination. |
| --remove-source-files | Deletes files from the source after a successful transfer — turns rsync into a move. |
| --inplace | Overwrites files in-place rather than via a temp file. If the transfer fails partway, the destination file is left corrupted. |
Frequently Asked Questions
What are rsync flags?
What does -avz mean in rsync?
What is the difference between rsync --include and --exclude?
Should I use the -z (--compress) flag with rsync?
Why does the trailing slash matter in rsync?
Related Tools
Need to manage SSH connections?
SSH Workbench lets you connect, browse files, and manage servers visually.
Try SSH Workbench Free