title: Why am I getting some extra, weird characters when making a file from grep output?
body: <p>I am doing a very basic command that never gave me trouble in the past, but is inexplicably returning undesired characters now. </p>
  
  <p>I am in BASH on linux, and simply want to search through a directory and make a file containing filenames that match a pattern:</p>
  
  <pre><code>ls | grep "*.file_ID" &gt; my_list.txt
  </code></pre>
  
  <p>...This works fine, and if I cat the data:</p>
  
  <pre><code>   cat my_list.txt
         seriesA.file_ID
         seriesB.file_ID
         seriesC.file_ID
  </code></pre>
  
  <p>However, when I try to feed this file into downstream processes, I keep getting a weird errors, as if the file isn't properly formatted as a list of file names. When I open the file in vim to reveal any unnecessary characters, I find the file actually looks like this:</p>
  
  <pre><code>vi my_list.txt
  
  ^[[00mseriesA.file_ID^[[00m
  ^[[00mseriesB.file_ID^[[00m
  ^[[00mseriesC.file_ID^[[00m
  </code></pre>
  
  <p>For some reason, every line is started and ended with the characters <code>^[[00m</code>. If I delete these characters, all of the downstream processes work fine. However, I need to have my scripts automatically make such a file list, so I can't keep going in and manually deleting these chars.</p>
  
  <p>Does anyone know what is producing the <code>^[[00m</code> characters? I don't have any idea where they are coming from, and need a to be able to generate files without them.</p>
  
  <p>Thanks!</p>