Online Linux Terminal Logo
OnlineLinuxTerminal
Operaciones de archivosCLI Manual

$cp

Copy files and directories to a destination path.

Sintaxis del comandoPOSIX Standard
cp [OPTIONS] SOURCE... DEST
Comunidad Linux2.4k En línea

Chatea con usuarios de Linux, aprende comandos y descarga guías PDF.

Prueba en vivo en la terminal interactiva

Simulación del lado del cliente sin instalación y con respuesta inmediata.

Abrir en terminal de pantalla completa ↗
bash — terminal

Descripción general y funcionamiento

`cp` (Copy) duplicates files or folders from a source to a destination. It supports copying single files, multiple files into target directories, and recursive directory tree replication with preservation of file modes and timestamps.

Opciones y banderas comunes

Flag / OptionDescription
-r, -RCopy directories and their contents recursively.
-pPreserve specified attributes like mode, ownership, and timestamps.
-aArchive mode (same as -dR --preserve=all) for exact backups.
-uCopy only when the SOURCE file is newer than the destination file.
-vVerbose output showing files as they are copied.

Ejemplos prácticos del mundo real

#1Create a backup copy of a configuration file
cp welcome.txt welcome.txt.bak && ls -l

Duplicates welcome.txt into welcome.txt.bak in the same directory.