6

How can I count how many folders (including subfolders) I have under an specific folder?

Dan Carley
  • 26,127
Max
  • 475

2 Answers2

14

Use find to select the directories and wc to count them.

find <directory> -mindepth 1 -type d | wc -l
Dan Carley
  • 26,127
0

tree -d | grep directories | awk -F' ' '{print $1}'

dyasny
  • 19,257