How to count the number of folders in a specific directory. I am using the following command, but it always provides an extra one.
find /directory/ -maxdept
No of directory we can find using below command
ls -l | grep "^d" | wc -l