D.Kuchkin
D.Kuchkin

Reputation: 1

SunOS. Find files that do not contain the substring 'foo' in the file name

Now I exclude files by their extension.

  find ./export/home/ ! \( -name *.log -o -name *.out -o -name *.tmp \)

But I also want to exclude files with the name containing some string 'foo'. Need some sort of analog " like '%foo%' " (PL\SQL), to exclude files such as "1_foo2".

I can not use the GNU version of the command "find".

Upvotes: 0

Views: 68

Answers (1)

jlliagre
jlliagre

Reputation: 30833

You are pretty close:

find ./export/home/ -type f ! \( -name "*.log" -o -name "*.out" -o 
                                 -name "*.tmp" -o -name "*foo*"  \)

Upvotes: 1

Related Questions