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
Count all files and subfolders, windows style:
dir=/YOUR/PATH;f=$(find $dir -type f | wc -l); d=$(find $dir -mindepth 1 -type d | wc -l); echo "$f Files, $d Folders"