In Bash, how does one match a regular expression with multiple criteria against a file name? For example, I\'d like to match against all the files with .txt or .log endings.
You can also do this:
shopt -s extglob for file in *.+(log|txt)
which could be easily extended to more alternatives:
for file in *.+(log|txt|mp3|gif|foo)