Negating arguments

The find command can also exclude things that match a pattern using !:

$ find . ! -name "*.txt" -print

This will match all the files whose names do not end in .txt. The following example shows the result of the command:

$ ls
list.txt  new.PY  new.txt  next.jpg  test.py

$ find . ! -name "*.txt" -print
.
./next.jpg
./test.py
./new.PY