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

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -