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

Popular posts from this blog

Eclipse formatter for java ending braces -

ruby - Nesting modules inside of a Rails eninge gem -

java - Are there any classes that implement javax.persistence.Parameter<T>? -