The cp command is a standard command in Linux used to copy files and directories from one location to another. It allows you to duplicate files or entire directories, making it a fundamental tool for file management in the Linux environment.
Basic Syntax
cp [options] source destination
Common Options
-r: Recursively copy directories and their contents.-i: Prompt before overwriting files.-u: Copy only when the source file is newer than the destination file or when the destination file is missing.-v: Verbosely show the files being copied.
Example Usage
To copy a file:
cp file.txt /path/to/destination/
To copy a directory and its contents:
cp -r directory_name /path/to/destination/
The cp command is essential for tasks such as backing up data and organizing files within the file system.
