rsync Command Generator — Build & Decode rsync Commands

rsync is powerful and unforgiving — one wrong flag and you've deleted the wrong side. Pick your options and get the exact command, with every flag explained and the dangerous ones flagged. Or paste an rsync command to decode it. Runs in your browser.

Your command

Or: decode an rsync command

Paste any rsync command — every flag gets explained.

The trailing slash is the whole game

This is the rsync rule that catches everyone: a trailing slash on the source means "the contents of".

The destination's trailing slash doesn't matter; the source's does. When in doubt, the builder above spells out which one you're getting.

Always dry-run before --delete

--delete removes anything in the destination that isn't in the source. Combined with a wrong path or a missing trailing slash, it can wipe a directory. Run it with -n (dry run) first, read every line it would change, then remove -n when you're sure. There is no undo.

Gotchas worth knowing

Frequently asked questions

What does rsync -avz mean?

a archive (recursive + preserve everything), v verbose, z compress during transfer. It's the everyday "mirror this folder" command, usually with a remote destination.

How do I copy a folder to a remote server with rsync?

rsync -avz /local/folder/ user@server:/remote/path/. The trailing slash on the source copies the contents; drop it to copy the folder itself.

How do I make rsync delete files removed from the source?

Add --delete, but run it with -n (dry run) first: rsync -avzn --delete src/ dest/ shows what would be removed without touching anything.

What's the difference between rsync src/ and src?

The trailing slash. src/ copies the contents into the destination; src copies the folder itself, creating dest/src/.

Archiving or searching files next? See the tar generator and find generator, or all tools on the home page.