find /home/csuser/testfiles . -type f -name "*.c" -exec mv '{}' /home/csuser/src/ \;
The above command will simply overwrite files which have the same name. How can I make mv
prompt me to either overwrite the existing file or replace it, for each file name which already exists at the target?
The manpage of the mv
command (man mv
) shows the following entry:
-i, --interactive
prompt before overwrite
So, using mv -i ...
prompts before overwriting.
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