Im trying to search for folders in the OS X terminal. Is there any way to filter the find results for folders?
2 Answers
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.
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
-
2