rsync Cheatsheet - File Sync
rsync's strength is transferring only the changed parts; with --delete it mirrors the destination to match the source, making it standard for log backups and site deploys. This table breaks down common flags and especially stresses running --dry-run (and --checksum to see differences) before the real sync to avoid accidental deletions.
Basic Sync 4
rsync -avz ./src /destSync src directory to dest (including src itself)
rsync -avz ./src/ /destSync src contents to dest (not src itself)
rsync -avz user@host:/remote /localPull from remote to local
rsync -avz /local user@host:/remotePush from local to remote
Transfer Options 5
-z, --compressCompress data during transfer
-n, --dry-runSimulate, no actual transfer
--partialKeep partially transferred files (resume)
--bwlimit=1MLimit bandwidth to 1MB/s
-e sshUse SSH as the transport
Display Options 6
-v, --verboseVerbose output
-q, --quietQuiet mode
--statsShow transfer statistics
-h, --human-readableHuman-readable numbers
--progressShow progress
-PSame as --partial --progress
Skip & Filter 5
-u, --updateSkip files newer on the target
-c, --checksumSkip by checksum (not time+size)
--exclude=.gitExclude the .git directory
--exclude-from=.rsyncignoreRead exclude rules from a file
--include=*.txtInclude specific files
Backup Options 4
-b, --backupBack up overwritten files
--suffix=.bakBackup file suffix
--backup-dir=/backupBack up to a given directory
--deleteDelete extra target files (mirror)
Archive Mode 7
-a, --archiveArchive mode (-rlptgoD)
-r, --recursiveRecurse into directories
-l, --linksPreserve symlinks
-p, --permsPreserve permissions
-t, --timesPreserve modification times
-g, --groupPreserve group
-o, --ownerPreserve owner
Tips
- src/ syncs contents, src syncs the directory itself.
- -a is shorthand for -rlptgoD, preserving nearly all attributes.
- --delete removes extra target files; add -n to simulate first.
- rsync is incremental — only deltas are sent, very efficient.
- Remote transfer uses SSH by default; -e overrides the command.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Jul 19, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us