In recent versions of bash
, the **
expression can be used to indicate matches for a particular directory while including sub-directories. This can be a big help when dealing with some messy filesystem structures.
|
|
This example would match .nc files in $year
and the folders below $year
. Depending on the shell configuration or if running within a script, shopt -s globstar
may be necessary to enable the capability.