I have a list of filenames with their paths like this
/some/path/or/another/RCrandomname.TRI
/another/path/NCrandomname2.TRI
/one/more/path/RCrandomname3.PCD
I would like to pick only the filenames (with their paths) whose basename starts with RC and have extension TRI so in the above example I would like to get just
/some/path/or/another/RCrandomname.TRI
if I had the basename only I could do
ls | grep "^RC.*.TRI$" > filenames
but here I have all the paths.
I have a requirement of using ls