Online Linux Terminal Logo
OnlineLinuxTerminal
Операции с файламиCLI Manual

$cp

Copy files and directories to a destination path.

Синтаксис командыPOSIX Standard
cp [OPTIONS] SOURCE... DEST
Сообщество Linux2.4k Онлайн

Общайтесь с пользователями Linux, учите команды и скачивайте шпаргалки.

Попробуйте в интерактивной песочнице

Клиентская симуляция без установки с мгновенным результатом.

Открыть в полноэкранном терминале ↗
bash — terminal

Обзор и принцип работы

`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 / 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.

Практические примеры использования

#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.