title: Meaning of command ls -lt | wc -l
body: <p>My friend just passed me this command to count the number of files in a directory:</p>
  
  <pre><code>$ ls -lt | wc -l
  </code></pre>
  
  <p>Can someone please help me flush out the meaning of this command? I know that <code>ls</code> is to list all the files. But what does <code>-lt</code> mean?</p>
  
  <p>Also, I get a different count if I use <code>ls | wc -l</code> with no <code>-lt</code> option. Why is that the case?</p>