$cp
Copy files and directories to a destination path.
cp [OPTIONS] SOURCE... DESTПопробуйте в интерактивной песочнице
Клиентская симуляция без установки с мгновенным результатом.
Обзор и принцип работы
`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.
Основные флаги и параметры команды
| 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. |
Практические примеры использования
cp welcome.txt welcome.txt.bak && ls -lDuplicates welcome.txt into welcome.txt.bak in the same directory.
Похожие команды Linux
Поиск файлов и директорий в иерархии каталогов по имени, типу, размеру или дате изменения.
Чтение и объединение содержимого файлов с выводом в терминал.
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.