如何find在指定目录的第二级不存在的bash文件夹?
我有像这样的结构:
- a -- aa --- aaa ---- myfolder <- if this folder dosen't exist I need to know that -- ab --- abc ---- myfolder <- if this folder dosen't exist I need to know that
我需要在每个“一个”二级子文件夹中find不存在的文件夹“我的文件夹”。 你能帮我吗?
你应该可以用find和test来做一些事情
find /path/to/search -type d \! -exec test -e '{}/myfolder' \; -print
要么
find /path/to/search -maxdepth 1 -type d \! -exec test -d '{}/myfolder' \; -print
已经很晚了,葡萄酒已经很好了,你的用例不清楚