ls | grep -E "\.(sty|cls)$"
\. matches literally "." - unescaped . matches any character(sty|cls) - matching "sty" or "cls" - | is or , and brackets limit the expression.$ causes the match to be at the end of the line
Note that you want grep -E or egrep , not grep -E as another option for template lists.
source share