Hi All, I have a directory in which all log files will be generated. Apart from the log files, there are a few other files also generated. I want the names of all files which does not end with .LOG.
consider the dir has the following files
I want only ebaf02012009.ERR file.
Unix Experts, Please help. Thanks in advance.
ls | grep -v "LOG$"
The exclamation mark in "find" means not.
find /dir/ -type f ! -name \*\.LOG -print
If *.ERR is the only type you are interested in:
find /dir/ -type f -name \*\.ERR -print
ls *.[^L][^O][^G]
ksh, zsh and bash support extended globbing:
[ksh]
print !(*.LOG)
[bash]
shopt -s extglob printf '%s\n' !(*.LOG)
[zsh]
print ^*.LOG