如何计算目录中的所有子文件夹?

Max*_*Max 6 linux find directory count

如何计算特定文件夹下有多少个文件夹(包括子文件夹)?

Dan*_*ley 14

使用find选择目录,并wc指望他们。

find <directory> -mindepth 1 -type d | wc -l
Run Code Online (Sandbox Code Playgroud)