Syncing files
Linux Command Line Quick Reference
1 min read
This section is 1 min read, full guide is 20 min read
Published Aug 18 2026
19
Show sections list
0
Log in to enable the "Like" button
0
Guide comments
0
Log in to enable the "Save" button
Respond to this guide
Guide Sections
Guide Comments
CLILinuxUbuntu
rsync synchronises files by comparing source and destination and transferring what is needed. It is useful for local copies, backups and remote transfers over SSH.
Synchronise with rsync
bash
rsync -av source/ destination/rsync -av --progress source/ destination/rsync -av --delete source/ destination/rsync -av source/ user@server:/path/rsync -av user@server:/path/ destination/rsync -avn --delete source/ destination/-a is archive mode and preserves common metadata while copying recursively. -v shows what is happening. -n is a dry run and makes no changes. --progress displays transfer progress.
--delete removes destination files that do not exist at the source, making the destination more closely mirror the source. Test it with -n first.
The trailing slash matters. source/ means copy the contents of source; source means copy the directory itself into the destination.