List files not matching a pattern?

Solution 1:

Use egrep-style extended pattern matching.

ls !(*.jar)

This is available starting with bash-2.02-alpha1. Must first be enabled with

shopt -s extglob

As of bash-4.1-alpha there is a config option to enable this by default.

Solution 2:

ls | grep -v '\.jar$'

for instance.

Solution 3:

Little known bash expansion rule:

ls !(*.jar)