Can I combine -i and -r?

0171

Yes, you can combine the -i and -r options in the cp command. When used together, cp -ir will copy directories and their contents recursively while also prompting you for confirmation before overwriting any existing files.

Here’s how you can use it:

cp -ir source_directory/ destination_directory/

In this command, if any files in destination_directory already exist, you will be prompted to confirm whether you want to overwrite them.

0 Comments

no data
Be the first to share your comment!