Online Linux Terminal Logo
OnlineLinuxTerminal
网络与传输CLI Manual

$rsync

Fast and versatile remote and local file-copying and synchronization tool.

命令语法POSIX Standard
rsync [OPTIONS] SOURCE... DEST
Linux 社区2.4k 在线

与真实 Linux 用户交流,学习常用命令并免费获取精美速查表 PDF。

在交互式终端沙盒中实时运行

无需安装的客户端实时仿真环境。

在全屏终端工作区中打开 ↗
bash — terminal

概述与工作原理

`rsync` (Remote Sync) synchronizes files and directories between two locations with delta-transfer algorithm, minimizing data transfer by sending only the differences between files.

常用参数与选项说明

Flag / OptionDescription
-a, --archiveArchive mode (preserves permissions, timestamps, symlinks, owners, groups).
-v, --verboseIncrease verbosity showing transferred files.
-z, --compressCompress file data during transfer.
--deleteDelete extraneous files from destination directories that no longer exist in source.

实际生产案例与代码范例

#1Synchronize local directory with remote backup
rsync -avz /home/user/projects/ user@backup-server:/backups/projects/

Transfers and synchronizes project folder with compression and archive preservation.