I have a bunch of files in a folder:
foo_1 foo_2 foo_3 bar_1 bar_2 buzz_1 ...
I want to find all the files that do not st
With extended globs:
shopt -s extglob ls !(bar_*) > filelist.txt
The !(pattern) matches anything but pattern, so !(bar_*) is any filename that does not start with bar_.
!(pattern)
pattern
!(bar_*)
bar_