yeouuu yeouuu - 2 years ago 94
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

Answer Source

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"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download