Software Published

Quick tip: Finding subfolders

When organizing folders you might want to find out if (and which) folder has subfolders. Let's figure out how to find those.

When organizing folders it can be needed to find out if and which folder has subfolders.

Let's say we have the following folder layout:

data
 disk1
 - subfolder1
 - subfolder2
 disk 2
 - subfolder3
 disk 3

Finding the folders which has subfolders is pretty easy:

find . -mindepth 2 -type d

Adjust the mindepth parameter to your needs. In the given case, it outputs:

./disk2/subfolder3
./disk1/subfolder2
./disk1/subfolder1

Keep reading

Related posts