← All commands
Topic hub File Management
Windows Linux File Management File System

Windows robocopy equivalent in Linux

Copies and synchronizes directories efficiently, transferring only changed content when possible.

Windows robocopy
Linux equivalents
Debian/Ubuntu same command
rsync -avh source/ destination/
Fedora same command
rsync -avh source/ destination/
Arch same command
rsync -avh source/ destination/

Overview

What this command does

Copies and synchronizes directories efficiently, transferring only changed content when possible.

Migration tip: rsync is the closest Linux equivalent to Robocopy. A trailing slash on the source changes whether the directory itself or only its contents are copied.

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 optionUse
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

This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.

DistributionPackage manager / baseEquivalent commandDifference 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

--delete permanently removes extra files from the destination. Run once with --dry-run before using it.

Keep learning

Related File Management commands