Windows copy equivalent in Linux
Copies files or entire directory trees to another location.
copy
cp
cp
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.
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.
For the broader concept behind this mapping, read Linux filesystem for Windows users.
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 option | Use |
|---|---|
cp -r | Copy directories recursively |
cp -i | Ask before overwriting (interactive) |
cp -v | Verbose — show what's being copied |
cp -p | Preserve timestamps and permissions |
cp -u | Only 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.
| Distribution | Package manager / base | Equivalent command | Difference 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
Keep learning