1

Ignore all matches to negated extglob pattern in recursive ls

view story
linux-howto

http://unix.stackexchange.com – I would like to recursively list all files in a directory which match a given input pattern using ls. (Oh, and this is in Bash). The only way I can think of to do this using ls is to shopt -s extglob and then use the ls --ignore=pattern option with the extended glob negate pattern !( pattern-list ). Seems kind of roundabout to negate in an ignore but otherwise wildcards don't recurse. Assuming I already have the directory to look in as dir and the pattern to match against as file, this is my current attempt: ls -AR --ignore='!('"${file}"')' ${dir} However, this does not seem to have the de (HowTos)