小编u15*_*iq5的帖子

查找所有目录,不包含其他目录

目前:

$ find -type d
./a
./a/sub
./b
./b/sub
./b/sub/dub
./c/sub
./c/bub
Run Code Online (Sandbox Code Playgroud)

我需要:

$ find -type d -not -contains -type d
./a/sub
./b/sub/dub
./c/sub
./c/bub
Run Code Online (Sandbox Code Playgroud)

如何排除包含其他(子)目录但不为空(包含文件)的目录?

bash find

4
推荐指数
1
解决办法
140
查看次数

标签 统计

bash ×1

find ×1