Finding strings with a specific number of letters, extensions included with grep
<p>If I pipe <code>ls</code> to <code>grep</code>, how would I be able to return a list of files with the condition that they only have an x amount of letters, extension included? </p>

<p>So for example, if <code>ls</code> gives me:</p>

<pre><code>abcde.jav a156e.exc test.c prog1.c qwert r.c 
</code></pre>

<p>and I'm looking for all files that contain strictly 5 letters, extensions included:</p>

<pre><code>a156e.exc test.c prog1.c qwert
</code></pre>

<p>I've tried:</p>

<pre><code>ls | grep '^[a-z]${5}'
ls | grep "^[a-z]|[a-z]$"
</code></pre>

<p>and other things like that, but I can't seem to get it. It seems like the solution should be really simple but I can't figure it out. Any help would be appreciated.</p>