Mirror a directory, deleting extra files
DestructiveMakes the destination an exact copy of the source, deleting destination files that no longer exist in the source.
Destructive: this command can permanently delete data. Check every value before running it.
rsync -a --delete source/ destinationEdit the highlighted values, then copy. They are inserted as typed, without shell escaping.
Report an issue (opens in a new tab) wrong command, wrong danger level, typo… (on GitHub)
Adapted from tldr-pages (common/rsync.md), licensed under CC BY 4.0.