I want to use the ls
command to list all files in directory a with .bar
extension but not .foo.bar
extension. The following picks up .foo.bar
files which I don't want
ls -l some/path/*.js
Must be simple. I just need an AND and NOT in there somehow.
Using bash
pathname expansion with [
pattern matching, you can write:
ls -l some/path/*[!(.foo)].bar