我有一个快速和令人难以解决的问题。 我通过
列出目录列表 find ~/me/ -maxdepth 1 -type d -not -name "test1" -and -not -name "test4"
$ find ~/me/ -maxdepth 1 -type d -not -name "test1" -and -not -name "test4"
/home/me/
/home/me/test2
/home/me/test3
我想使用类似find ~/me/ -maxdepth 1 -type d -not -name "test1" -and -not -name "test4" | xargs rm -rf
之类的内容,但是该搜索显示了以下内容:
/ home / me root dir 。
我一直在寻找一种不在搜索结果中包含它的方法。任何提示? 提前谢谢。
答案 0 :(得分:7)
-mindepth 1
没有为你工作?