How to make rm -fr command to be interactive

In this post I am sharing the tip, how to make rm -fr command to be interactive. As we know if you hit the command rm along with switch -fr ,it will remove the files and directory recursively. Sometimes because of human mistake any important file or directory can be removed.
When you hit the command rm -fr it will not ask any question and it will remove the file or folder. To avoid such kind of mistake it is good to have interaction of question before removing any file/directory.

To make rm -fr command to be interactive ,create a blank file named -i in that directory where important directory/file exists. You can also create -i file in / .By this method, before recursively and forcefully removing the directories and files,it will first ask question to be removed

touch ./-i

Reference

interactive-rm-command

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.