shell发现不在搜索结果中显示根目录

时间:2013-04-15 10:19:33

标签: linux bash shell

我有一个快速和令人难以解决的问题。 我通过

列出目录列表

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

我一直在寻找一种不在搜索结果中包含它的方法。任何提示? 提前谢谢。

1 个答案:

答案 0 :(得分:7)

-mindepth 1没有为你工作?