Here are some common options for the cp command:
-
-r: Recursively copy directories and their contents.cp -r source_directory/ destination_directory/ -
-i: Interactive mode; prompts before overwriting files.cp -i source_file destination_file -
-u: Copy only when the source file is newer than the destination file or when the destination file is missing.cp -u source_file destination_file -
-p: Preserve file attributes (timestamps, permissions, etc.).cp -p source_file destination_file -
-v: Verbose mode; shows the files being copied.cp -v source_file destination_file -
-a: Archive mode; preserves attributes and copies directories recursively.cp -a source_directory/ destination_directory/
These options can be combined as needed. For example:
cp -rv source_directory/ destination_directory/
If you have more questions or need further clarification, feel free to ask!
