Searching for file names in a directory while ignoring certain file names

Sun Solaris Unix Question

Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain extensions. For example :

Files in directory
----------------
testfile1.txt
testfile2.txt
testfile3.txt
testfile4.txt
testfile1.exe
testfile2.exe
testfile3.exe
testfile4.exe

I have a find command like :

find . -name '*' -print > filelist.lst

This would obviously give me all of the file names listed above in the file called filelist.lst.

However, what command syntax would I use if I wanted to ignore *.exe files. So, in the end this find command should generate a file called filelist.lst which should contain only the names of the files that end in .txt.

I tried the -not command but that is not valid in my version of Sun Solaris. (i.e. find . -name "' -not \( -name ".exe" \) -print > filelist.lst )

---------- Post updated at 03:09 PM ---------- Previous update was at 02:57 PM ----------

Disregard. I finally found the answer.

find . -name '' ! -name '.exe' -print > filelist.lst

anything keeping you from doing your find and doing a |grep -v on whatever you want to exclude?
Or alternatively |grep ".txt"

This should be enough.

find . ! -name '*.exe' -print > filelist.lst