You could use -I switch if you want to be prompted only once:

rm -rI sampledir/

from man rm:

-I     prompt once before removing more than three files, or when removing recursively.
       Less intrusive than -i, while still giving protection against most mistake

and use -f for "no prompt":

-f, --force
       ignore nonexistent files and arguments, never prompt


rm -rf sampledir/
  • 5
Reply Report

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags