Windows xcopy equivalent in Linux
Copies directories with more control than cp — supports sync, progress display, resume, and remote copying.
xcopy
rsync -av
rsync -av
rsync -av
Overview
What this command does
Copies directories with more control than cp — supports sync, progress display, resume, and remote copying.
rsync only copies changed files, making it far faster than xcopy for large backups. It can also copy over SSH to remote machines.Practical tasks
Common use cases
Advanced copy with sync & progress
Copies directories with more control than cp — supports sync, progress display, resume, and remote copying.
rsync -av
Archive mode + verbose output
rsync --progress
Show per-file transfer progress
rsync --delete
Delete files in dest not in source (true sync)
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
rsync -av Source/ Dest/
rsync -av --progress Source/ Dest/
rsync -av --delete Source/ Dest/
rsync -avz ~/Documents/ user@server:/backup/
Walkthrough
Examples with explanations
# Windows: xcopy /s /e /i Source Dest
rsync -av Source/ Dest/ # copy directory
rsync -av --progress Source/ Dest/ # show progress
# Sync (delete files removed from source):
rsync -av --delete Source/ Dest/ # mirror source to dest
# Backup to a remote server over SSH:
rsync -avz ~/Documents/ user@server:/backup/
Reference
Common options and variations
| Command or option | Use |
|---|---|
rsync -av | Archive mode + verbose output |
rsync --progress | Show per-file transfer progress |
rsync --delete | Delete files in dest not in source (true sync) |
rsync -n | Dry run — preview without copying |
rsync -avz | Compress data during transfer |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | rsync -av |
Same command on this distribution. |
| Fedora | same command | rsync -av |
Same command on this distribution. |
| Arch | same command | rsync -av |
Same command on this distribution. |
Important
What to watch out for
Keep learning