shell - Use bash to find first folder name that contains a string -
i in bash:
- in current directory, find first folder contains "foo" in name
i've been playing around find command, little confused. suggestions?
you can use -quit
option of find
:
find <dir> -maxdepth 1 -type d -name '*foo*' -print -quit
Comments
Post a Comment