Skip to Content

bash : rm -rf *

Conceptor's picture

how to prevent running rm -rf on a directory other words how to enforce running rm -ri .

-i is interactive it will ask you if you are sure or not (hay7lfek ya 3aney)

well it's a trick

touch -- -i rm -rf *

it will ask you as if you run rm with -i .Shreif this good for you on your best candidate directory to deleted by mistake run :

for i in `find . -type d `;do touch $i/-i ;done rm -rf *


Dr. Radut | blog