How do I count the number of directories in Linux?

How do I count the number of directories in Linux?
Answer
  1. Find all folders in total, including subdirectories: find /mount/point -type d | wc -l.
  2. Find all folders in the root directory (not including subdirectories): find /mount/point -maxdepth 1 -mindepth 1 -type d | wc -l.
 

Tìm kiếm

Back
Top