With the appropriate version of find you can do something similar, but this is a bit overkill:
find . -maxdepth 1 ! -name '*.jar'
find finds files. Argument indicates that you want to start a search from . , that is, the current directory. -maxdepth 1 says that you need to search only one level, i.e. current directory. ! -name '*.jar' ! -name '*.jar' searches for all files that do not match the regular expression *.jar .
As I said, this was a bit overkill for this application, but if you remove -maxdepth 1 , you can recursively look for all files other than jar, or whatever is easy for you.
Dan Fego Dec 15 '11 at 19:22 2011-12-15 19:22
source share