If I pipe ls- grephow can I return a list of files with the condition that they only have the number of letters x, the extension is added?
So, for example, if lsit gives me:
abcde.jav a156e.exc test.c prog1.c qwert r.c
and I'm looking for all files containing strictly 5 letters, including extensions:
a156e.exc test.c prog1.c qwert
I tried:
ls | grep '^[a-z]${5}'
ls | grep "^[a-z]|[a-z]$"
and other similar things, but I canβt understand. It seems like the solution should be really simple, but I can't figure it out. Any help would be appreciated.
source
share