rm -r path :如何避免在每个级别被询问?

jdl*_*jdl 2 rm

如果我想删除该路径,如何避免在每个级别被询问?我只想删除路径中的所有内容?

don*_*sti 5

-I如果只想提示一次,可以使用switch:

rm -rI sampledir/
Run Code Online (Sandbox Code Playgroud)

来自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
Run Code Online (Sandbox Code Playgroud)

-f用于“无提示”:

-f, --force
       ignore nonexistent files and arguments, never prompt
Run Code Online (Sandbox Code Playgroud)

所以:

rm -rf sampledir/
Run Code Online (Sandbox Code Playgroud)