Rm

rm -r path :如何避免在每個級別都被問到?

  • June 24, 2013

如果我想刪除該路徑,如何避免在每個級別被詢問?我只想刪除路徑中的所有內容?

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

rm -rI sampledir/

來自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

-f用於“無提示”:

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

所以:

rm -rf sampledir/

引用自:https://unix.stackexchange.com/questions/80460