Say I want to copy the contents of a directory excluding files and folders whose names contain the word \'Music\'.
cp [exclude-matches] *Music* /target_direc
In bash, an alternative to shopt -s extglob
is the GLOBIGNORE variable. It's not really better, but I find it easier to remember.
An example that may be what the original poster wanted:
GLOBIGNORE="*techno*"; cp *Music* /only_good_music/
When done, unset GLOBIGNORE
to be able to rm *techno*
in the source directory.