title: Print list of files in a directory to a text file (but not the text file itself) from terminal
body: <p>I would like to print all the filenames of every file in a directory to a <code>.txt</code> file.</p>
  
  <p>Let's assume that I had a directory with 3 files:</p>
  
  <pre><code>file1.txt
  file2.txt
  file3.txt
  </code></pre>
  
  <p>and I tried using <code>ls &gt; output.txt</code>.</p>
  
  <p>The thing is that when I open <code>output.txt</code> I find this list:</p>
  
  <pre><code>file1.txt
  file2.txt
  file3.txt
  output.txt
  </code></pre>
  
  <p>Is there a way to avoid printing the name of the file where I'm redirecting the output? Or better is there a command able to print all the filenames of files in a directory except one?</p>