cp
Linux · Files · available in the simulator
What it does
Copy files and directories. Wildcards: * (any number of characters), ? (0 or 1 character).
Syntax
cp [opciones] origen... destino
Options and parameters
-RCopy directories recursively.
-iPrompt before overwrite.
-vExplain what is being done.
-pPreserve file attributes such as mode, ownership, and timestamps.
-fForce copy by removing existing destination files if necessary.
-rCopy directories recursively.
cp -r carpeta/ copia/-aArchive mode; copy recursively and preserve attributes, timestamps, and links.
cp -a origen/ destino/-nDo not overwrite an existing file.
-uCopy only when the source file is newer than the destination file.
-lHard link files instead of copying.
-sMake symbolic links instead of copying.
Usage examples
cp error ..cp -R sistemas backupcp -i a.txt b.txtcp archivo.txt copia.txtcp -r src/ backup/cp -r carpeta/ copia/cp -a origen/ destino/