I want to find some files, in a non GNU environment
- in the current directory only
- with extension *.ext1 and *.ext2,
- but not name1.* or name2.*
The following command works, but may be not efficient, because the shell expands
./* and find can get a huge list of files and directories.
find ./* -prune \( -name '*ext1' -o -name '*ext2' \) -a ! \( -name 'name1*' -o -name 'name2*' \)
I'm working on AIX, there is no -maxdepth option.