UNIX 'ls' command exclude wildcard

ls, unix

Solution

Try this:

$ ls [a-b][13]
a1  a3  b1  b3

Or

$ shopt -s extglob
$ ls !(*2)
a1  a3  b1  b3

Problem

I have files a1 a2 a3 b1 b2 b3 and I need to exclude a2 and b2 from the list using `ls` command only.

Original source