0
2
Is there any option to enable confirmation for the rm -rf . We had an alias setup for rm=rm -i so whenever we delete a file it asks for confirmation but when -f flag is supplied it will not asks for confirmation.
So is there any option to ask confirmation for rm (Or rm -r) command with force flag that is for rm -f and rm -rf commands?
In .bashrc file tried setting up of alias as
alias 'rm -rf'='rm -rfi'
but its not working. By referring this url : I tried to create a function as
function rm ()
{ if [[ $@ == "-rf" ]];
then command rm -rfi
else command rm "$@"
fi }
but this also not working. Can anyone please help me to fix this.