Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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.