Windows robocopy equivalent in Linux
Copies and synchronizes directories efficiently, transferring only changed content when possible.
robocopy
rsync -avh source/ destination/
rsync -avh source/ destination/
rsync -avh source/ destination/
Overview
What this command does
On Windows, "robocopy" is used to synchronize directory trees. On Linux, the closest practical mapping shown here is "rsync -avh source/ destination/". Copies and synchronizes directories efficiently, transferring only changed content when possible. This reference is grouped under File Management → File System.
Windows → Linux context
What changes when you use this on Linux?
Equivalent task, different tool
Windows robocopy maps to rsync -avh source/ destination/ for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.
Portable across the compared distros
The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.
Command-specific caution
--delete permanently removes extra files from the destination. Run once with --dry-run before using it.
For the broader concept behind this mapping, read Linux filesystem for Windows users.
Practical tasks
Common use cases
Synchronize directory trees
Copies and synchronizes directories efficiently, transferring only changed content when possible.
rsync -avh source/ destination/
Synchronize folder contents
rsync -avh --progress source/ destination/
Show transfer progress
rsync -avh --delete source/ destination/
Make destination mirror the source
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
rsync -avh source/ destination/
rsync -avh --progress source/ destination/
rsync -avh --delete source/ destination/
Walkthrough
Examples with explanations
rsync -avh source/ destination/ # copy changed files and preserve metadata
rsync -avh --progress source/ destination/ # show progress during the copy
rsync -avh --delete source/ destination/ # remove destination files missing from source
Reference
Common options and variations
| Command or option | Use |
|---|---|
rsync -avh source/ destination/ | Synchronize folder contents |
rsync -avh --progress source/ destination/ | Show transfer progress |
rsync -avh --delete source/ destination/ | Make destination mirror the source |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
Debian/Ubuntu, Fedora and Arch all use "rsync -avh source/ destination/" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | rsync -avh source/ destination/ |
Same command on this distribution. |
| Fedora | same command | rsync -avh source/ destination/ |
Same command on this distribution. |
| Arch | same command | rsync -avh source/ destination/ |
Same command on this distribution. |
Important
What to watch out for
Keep learning