```stata
rm -f index.html
find build -type f ! -name 'do' ! -name '*.do' -mindepth 1 -maxdepth 1 -exec rm {} \;
```

Put find arguments in preferred order
user
```stata
rm -f index.html
find build -mindepth 1 -maxdepth 1 -type f ! -name 'do' ! -name '*.do' -exec rm {} \;
```
assistant