🧀 Learn Linux

Commonly used · Organize files

cp:Copy files or directories

Put in free practice

Syntax

cp [-rRa] source… target

Options

-r / -R
Copy directories recursively
-a
The teaching environment is processed by recursive copying
-f
Allow overwriting of normal files

Examples

cp -r projects projects-backup

Usage and sandbox support

Multiple source files require a directory as a target. True cp -a also retains more metadata.

Hands-on exercises

Full documentation ↗

Related commands