title: How to cd into the first directory after sorting
body: <p>I have a folder in which there are directories</p>
  
  <pre><code>ABC_1
  ABC_2
  ABC_3
  ABC_4
  ABC_5
  Test
  XYZ
  </code></pre>
  
  <p>I want to sort them by date,remove the directories which do not contain ABC in their name and cd into the first directory.</p>
  
  <p>I tried</p>
  
  <pre><code>cd $(/bin/ls -t1 | head -n 1)
  </code></pre>
  
  <p>This is not working.
  Any help would be much appreciated<br>
    Thanks.</p>