So I've aliased the commands rm/cp/mv to use interactive (-i) mode by default to avoid accidentally deleting things, but sometimes this is pretty inconvenient.
I would like to be able to say 'y' to all the prompts of the form:
mv: overwrite `file_1'? y
mv: overwrite `file_2'? y
without typing 'y' many many times. Is there a way to do this?
The y characters from the yes command will respond "yes" to each prompt automatically. Here, the yes command outputs "n" in a constant stream to the rm -i command, answering "no" to all the same questions.
You can control exactly which attributes are copied with the --preserve option. Make a backup of each existing destination file that would otherwise be overwritten or removed. The control parameter specifies what version control method to use; see version control for details.
Usually, when you run a cp command, it overwrites the destination file(s) or directory as shown. To run cp in interactive mode so that it prompts you before overwriting an existing file or directory, use the -i flag as shown.
You can use cp -rf option to forcefully overwrite the destination file if already exists.
you can use back slash before cp
\cp -rf /from/directory/* to/directory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With