Linux – Using ls to Find Files Ending in a Character, Ignoring Extension

command linelinuxls

I am supposed to use ls to find files that end in a certain letter, but it does not matter if the file has an extension or not.

For example, I want it to do this

> ls
test test.txt test.ascii other.txt

> ls [something]
test test.txt test.ascii

So that I can find files that end with a 't', but it doesn't include the file where the extension ends in t

Edit:
I am supposed to assume that the only period characters in the filename will be for the extension and there will be no others

Best Answer

something=

 |grep -e ".*t\.[^.]*" -e "^[^.]*t$"
Related Question