Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

on an unix shell, how can i find all directories with a certain name?

say i have a folder structure like


and i am searching for folders named foo, i would want to return a list like:


how could i do this?


share|improve this question

1 Answer 1

find /home -name foo -type d
share|improve this answer
Which means (as a matter of education): print out the paths of all items beneath the directory /home that both have the name foo and are directories (-type d) –  Slartibartfast Jul 11 '10 at 2:29
thanks :) that worked ;) –  tarnoob Jul 14 '10 at 18:38
@tarnoob: You're welcome. You can mark this answer as accepted then. –  Dennis Williamson Jul 15 '10 at 0:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.