globstar
A bash 4 option that makes a double star in a glob match files at any depth of subdirectories.
In more detail
Turn it on with shopt -s globstar; then **/*.md matches Markdown files in every directory below. It is off by default and missing from bash 3.2 and POSIX sh, where find does the job instead.
Example
shopt -s globstar; ls **/*.mdRelated terms
- glob pattern — A pattern that matches names using * for any run of characters, a question mark for one character and [abc] for one of a set.
- find command — The find command, which walks a directory tree and prints, or acts on, every entry that passes its tests.
- shopt — The bash builtin that switches optional shell behaviours on and off, such as globstar or nullglob.
Taught in
- Which Shell Am I In, And Getting Bash Five — Bash Scripting & Command Line Automation