如何搜索所有子目录以找到具有特定名称的子目录?

ber*_*436 16 filesystems directory find directory-structure

假设我有一个顶级目录/dir和许多子目录。如何搜索 的子目录/dir以找到名为的子目录x/x/dir/x/x/x/target

这个问题类似于,但不完全是我要找的:find command for某些子目录

我不是在寻找文件,只是寻找具有特定名称的目录。

Vin*_*inz 24

试试find /dir -type d -name "your_dir_name"

替换/dir为您的目录名称,并替换"your_dir_name"为您要查找的名称。

-type d会告诉find只搜索目录。