title: Bash how to create a txt file of all file names in a directory
body: <p>I am sure there is a simple answer but I have been struggling to create a txt file of all the file names in a directory.</p>
  
  <p>I am currently in the directory of where I need to collect all the file names of. This is what I have tried.</p>
  
  <pre><code>for i in ls; $i |../log.txt ; done
  </code></pre>
  
  <p>The <code>log.txt</code> file exists in the directory above.</p>