$cp
Copy files and directories to a destination path.
cp [OPTIONS] SOURCE... DESTLive im interaktiven Terminal ausprobieren
Client-seitige Simulation ohne Installation mit sofortigem Feedback.
Überblick & Funktionsweise
`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.
Wichtige Optionen und Flags
| Flag / Option | Description |
|---|---|
| -r, -R | Copy directories and their contents recursively. |
| -p | Preserve specified attributes like mode, ownership, and timestamps. |
| -a | Archive mode (same as -dR --preserve=all) for exact backups. |
| -u | Copy only when the SOURCE file is newer than the destination file. |
| -v | Verbose output showing files as they are copied. |
Praktische Anwendungsbeispiele
cp welcome.txt welcome.txt.bak && ls -lDuplicates welcome.txt into welcome.txt.bak in the same directory.
Verwandte Linux-Befehle
Durchsuchen Sie Verzeichnishierarchien nach Dateien basierend auf Name, Typ, Größe oder Änderungsdatum.
Dateiinhalte verketten und auf der Standardausgabe ausgeben.
Create new directories and folder hierarchies.
Remove files or directories from the filesystem.
Move or rename files and directories.
Create empty files or update file access and modification timestamps.