rsync Cheatsheet - File Sync
All essential rsync commands organized by use case, with 31+ entries you can copy and run directly. Find the right command fast when you need it.
Back to SysOpsBasic Sync 4
rsync -avz ./src /destSync src Directory到 dest(含 src 本身)
rsync -avz ./src/ /destSync src 内容到 dest(不含 src 本身)
rsync -avz user@host:/remote /local从远程拉取到本地
rsync -avz /local user@host:/remote推送本地到远程
Transfer Options 5
-z, --compress传输时Compress数据
-n, --dry-run模拟Execute,不实际传输
--partial保留部分传输的File(supports断点续传)
--bwlimit=1M限制带宽为 1MB/s
-e ssh指定使用 SSH 作为传输channel
Display Options 6
-v, --verboseverboseOutput
-q, --quietsilent模式
--statsDisplay传输统计信息
-h, --human-readable人class可读的数字格式
--progressDisplay传输进度
-P同 --partial --progress
Skip & Filter 5
-u, --updateJump过目标端Update的File
-c, --checksum基于校验和Jump过(而非时间+size)
--exclude=.git排除 .git Directory
--exclude-from=.rsyncignore从FileRead排除规则
--include=*.txtpackage含特定File
Backup Options 4
-b, --backupbackupoverwrite的File
--suffix=.bakbackupFile后缀
--backup-dir=/backupbackup到指定Directory
--deleteDelete目标端多余File(镜像Sync)
Archive Mode 7
-a, --archive归档模式(-rlptgoD)
-r, --recursiverecursively处理Directory
-l, --links保留符号链接
-p, --perms保留Permission
-t, --times保留时间戳
-g, --group保留User组
-o, --owner保留所有者
💡 Tips
- src/ 和 src 的区别:带斜杠Sync内容,不带SyncDirectory本身。
- -a 是 -rlptgoD 的alias,保留几乎所有Fileproperty。
- --delete 会Delete目标端多余File,首次使用建议加 -n 模拟。
- rsync 基于增量传输,只传差异部分,效率高。
- 远程传输默认用 SSH,可用 -e 指定其他命令或Options。
Official References
Commands are compiled from the official docs below. Click to verify the latest usage.
Maintained by LaoHand
Publicly updated on Jul 19, 2026, continuously proofread against official docs.
Found an error? Report it
Wrong command or description? Open an issue to help us fix it.
Found an error? Report it