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

Windows copy equivalent in Linux

Copies files or entire directory trees to another location.

Windows copy
→
Linux equivalents
Debian/Ubuntu same command
cp
Fedora same command
cp
Arch same command
cp

Overview

What this command does

On Windows, "copy" is used to copy files and folders. On Linux, the closest practical mapping shown here is "cp". Copies files or entire directory trees to another location. This reference is grouped under File Management → File System.

Migration tip: To copy a <strong>directory and all its contents</strong>, you must use <code>cp -r</code> (recursive). Forgetting <code>-r</code> is one of the most common beginner mistakes.

Windows → Linux context

What changes when you use this on Linux?

Equivalent task, different tool

Windows copy maps to cp 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

cp will silently overwrite existing files by default. Use cp -i to be prompted before overwriting.

Practical tasks

Common use cases

Copy files and folders

Copies files or entire directory trees to another location.

cp -r

Copy directories recursively

cp -i

Ask before overwriting (interactive)

cp -v

Verbose — show what's being copied

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

cp file.txt backup.txt
cp file.txt /home/user/docs/
cp -r MyFolder Backup
cp -rv MyFolder /backup/

Walkthrough

Examples with explanations

# Windows: copy file.txt backup.txt
cp file.txt backup.txt          # copy a file
cp file.txt /home/user/docs/   # copy to another directory

# Windows: xcopy /s /e MyFolder Backup
cp -r MyFolder Backup          # copy an entire folder
cp -rv MyFolder /backup/       # copy folder, show progress

Reference

Common options and variations

Command or optionUse
cp -rCopy directories recursively
cp -iAsk before overwriting (interactive)
cp -vVerbose — show what's being copied
cp -pPreserve timestamps and permissions
cp -uOnly copy if source is newer

Distro differences

Debian/Ubuntu vs Fedora vs Arch

Debian/Ubuntu, Fedora and Arch all use "cp" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu same command cp Same command on this distribution.
Fedora same command cp Same command on this distribution.
Arch same command cp Same command on this distribution.

Important

What to watch out for

cp will silently overwrite existing files by default. Use cp -i to be prompted before overwriting.

Keep learning

Related File Management commands