Whenever I use rm
to remove files in my Cygwin terminal, the file gets deleted without any warning. This is particularly annoying when I try to remove multiple files with the wildcard and some other characters.
Since Cygwin is Linux shell running inside the Windows OS, you can try something similar to what you would do in actual Linux. Open your .bashrc
file in the Vim editor:
vi ~/.bashrc
Add the following line at the end of the file
alias rm=’rm –I’
This tells Cygwin to run the command rm
as rm -I
, which is remove in information mode. This will generate the warning prompt each time you try to rm
a file.
You might also want to change the settings for the root user, and possibly other users. Have a look at this useful article for more information.