Đỗ Chí Hải
New member
How do I count the number of directories in Linux?
Answer
Answer
- Find all folders in total, including subdirectories: find /mount/point -type d | wc -l.
- Find all folders in the root directory (not including subdirectories): find /mount/point -maxdepth 1 -mindepth 1 -type d | wc -l.