网络与传输CLI Manual
$rsync
Fast and versatile remote and local file-copying and synchronization tool.
命令语法POSIX Standard
rsync [OPTIONS] SOURCE... DEST在交互式终端沙盒中实时运行
无需安装的客户端实时仿真环境。
bash — terminal
AST Sandbox (Free)
概述与工作原理
`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 / Option | Description |
|---|---|
| -a, --archive | Archive mode (preserves permissions, timestamps, symlinks, owners, groups). |
| -v, --verbose | Increase verbosity showing transferred files. |
| -z, --compress | Compress file data during transfer. |
| --delete | Delete 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.
相关 Linux 常用命令
$cp文件操作
Copy files and directories to a destination path.
$curl网络与传输
通过 HTTP、HTTPS、FTP 和 REST API 在网络服务器之间传输数据。
$wget网络与传输
Non-interactive network downloader for HTTP, HTTPS, and FTP.
$tar归档与压缩
创建、查看和解压 .tar 及 .tar.gz 压缩归档文件。
$ping网络与传输
Send ICMP ECHO_REQUEST to network hosts to test connectivity and latency.
$netstat网络与传输
Print network connections, routing tables, interface statistics, and listening ports.