In Unix, how do you remove everything in the current directory and below it?

前端 未结 10 1981
庸人自扰
庸人自扰 2021-01-29 21:57

I know this will delete everything in a subdirectory and below it:

rm -rf 

But how do you delete everything in the current d

10条回答
  •  心在旅途
    2021-01-29 22:34

    This simplest safe & general solution is probably:

    find -mindepth 1 -maxdepth 1 -print0 | xargs -0 rm -rf
    

提交回复
热议问题