Syncing files

Linux Command Line Quick Reference

1 min read

Published Aug 18 2026


19
0
0
0

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.

© 2025 SimpleSteps.guide
AboutFAQPoliciesContact
Linux Command Line Quick Reference | Syncing files | SimpleSteps.guide