DEV Community

Mohamed Yahia
Mohamed Yahia

Posted on • Updated on

How to delete files in the terminal safely

To mitigate the problem of deletion by mistake. Two options were introduced to the rm command

-i option shows an interactive prompt asking you if you want to delete that item, for several items or a folder it will ask for every file and folder if you want it to be deleted.

-I option is less intrusive and will ask only if you were to delete more than 3 files or a folder and it will give only one prompt for all.

Try it and tell me what you think.

Top comments (0)