0

Im trying to search for folders in the OS X terminal. Is there any way to filter the find results for folders?

0

2 Answers 2

2

Is there any way to filter the find results for folders?

To list all the directory and sub-directory names:

find . -type d

Further reading

  • find - Search a folder hierarchy for filename(s) that meet a desired criteria.
-1

the ls command can find directories too

ls -l | grep ^d

ls is list
-l is for the long listing format but that's optional
grep means only match d which means only matches lines that start with d

1
  • 2
    Can you explain this in more detail?
    – bwDraco
    Jul 13, 2015 at 22:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .