Home > Software engineering >  How to get a count of all the folders/directories in a git repository?
How to get a count of all the folders/directories in a git repository?

Time:12-08

I know I can use the following to count the number of files in a repo:

git ls-files | wc -l

I just wonder if there is a similar method to count all folders (including hidden and subfolders).

I have tried:

ls -d /mnt/c/Users/USERNAME/GIT/REPO/*/ |wc -l

but the above only lists the folders ignoring subfolders and hidden folders.

CodePudding user response:

Maybe:

find /mnt/c/Users/USERNAME/GIT/REPO/ -type d | wc -l
  • Related