How to Sync Files Efficiently in Linux (rsync)
rsync synchronizes files and directories between locations, transferring only the parts of files that have actually changed.
Published September 30, 2026
rsync synchronizes files and directories between locations, transferring only the parts of files that have actually changed.
Key points
- Far more efficient than scp for repeated syncs, since unchanged files are skipped entirely
- rsync -avz source/ destination/ preserves permissions and timestamps (a), shows progress (v), and compresses during transfer (z)
- A trailing slash on the source directory matters — it controls whether the directory itself is copied or just its contents
Example
rsync -avz ./project/ user@server:/var/www/project/