Saturday, 24 August 2013

Filtering the result of the find command, so that it returns only directories

Filtering the result of the find command, so that it returns only directories

Is it possible to get only the results from find that are directory paths?
Using find with some option, or using grep or some other utility the
results are piped into as a filter?
I thought something like find | grep */$ might work, but it doesn't. From
some other testing where I "grepped for" a folder with a specific name it
seems like I get a hit for folder_name$ but not for folder_name/$. This
seems conterintuitive. How can I grep for lines that end with /?

No comments:

Post a Comment