yeouuu yeouuu - 8 months ago 33
Linux Question

Find files ending with *.html but not *-partial.html

I'm refactoring some build tasks in my grunt and I'm trying to find a way to search for files ending with

but not

Is there some tool or commandline to find all these files?

Not working example:
find *.html --exclude=*-partial.html


find supports logical operators, specifically -and and -not, so you could look for all the files that end in .html but do not end in -partial.html:

find . -name "*.html" -and -not -name "*-partial.html"