title: Is it possible to list files that match a pattern with ls?
body: <p>I want to list files of a directory with <code>ls</code> that match a pattern without using <code>grep</code>. Is it possible?</p>
  
  <p>The point is to retrieve all files that match this pattern <code>'^\Extra_text_[0-9]\{10\}.csv'</code>
  and count how much I got.</p>
  
  <p>I tried this code:</p>
  
  <p><code>ls | grep '^\Extra_text_[0-9]\{10\}.csv'</code>  </p>
  
  <p><code>InputName=' | grep ^\Extra_text_[0-9]\{10\}.csv'</code></p>
  
  <p><code>fileCount=`ls $INPUT_FILE/$InputName 2&gt;/dev/null | wc -l`</code></p>
  
  <p><code>echo "$fileCount</code></p>
  
  <p><i> But it doesn't work!  :/ </i></p>