🐧 Linux / Shell Scripting
Intermediate
How does rsync work and when do you use it?
Answer
rsync is a fast file synchronization tool that transfers only the differences (deltas) between source and destination, making it efficient for large directories. Common usage: rsync -avz /source/ user@remote:/dest/. Flags: -a (archive: preserves permissions, timestamps, symlinks, ownership), -v (verbose), -z (compress during transfer), --delete (remove files at destination that no longer exist at source), --dry-run (preview without making changes), --exclude='*.log' (skip patterns), --progress (show per-file progress). Unlike scp, rsync resumes interrupted transfers. It is the standard tool for backups, deployments, and server migrations.