Linux Commands Helper
💬 Your AI-powered Linux assistant
rsync Command - Remote File and Directory Synchronization
The rsync command is used to efficiently synchronize files and directories between two locations over a network or locally.
Syntax
rsync [options] source destination
Examples
rsync -av /home/user/ /backup/user/
Synchronize /home/user to /backup/user preserving permissions, times, and symbolic links.
rsync -avz user@remote:/var/www/ /local/www/
Synchronize /var/www from remote server to local /local/www directory with compression.
Notes
- rsync only copies differences between source and destination, saving bandwidth and time.
- Commonly used options include
-a
(archive),-v
(verbose),-z
(compress),--delete
(delete files in destination not present in source).