rsync -avn --delete /home/user/docs/ /mnt/backup/docs/

Category: Backup & Restore

rsync -avn --delete /home/user/docs/ /mnt/backup/docs/

Dry-run a mirror sync to preview deletions

The -n (dry-run) flag makes rsync only report what it would copy or delete, writing nothing. --delete means removing destination files that no longer exist in the source. Run this preview first, then drop the -n to execute, the recommended habit before any destructive sync.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.