title: remove \n and keep space in linux
body: <p>I have a file contained \n hidden behind each line: </p>
  
  <p>input:</p>
  
  <pre><code>s3741206\n
  s2561284\n
  s4411364\n
  s2516482\n
  s2071534\n
  s2074633\n
  s7856856\n
  s11957134\n
  s682333\n
  s9378200\n
  s1862626\n
  </code></pre>
  
  <p>I want to remove \n behind</p>
  
  <p>desired output:</p>
  
  <pre><code>s3741206
  s2561284
  s4411364
  s2516482
  s2071534
  s2074633
  s7856856
  s11957134
  s682333
  s9378200
  s1862626
  </code></pre>
  
  <p>however, I try this:</p>
  
  <blockquote>
    <p>tr -d '\n' &lt; file1 > file2</p>
  </blockquote>
  
  <p>but it goes like below without space and new line
         s3741206s2561284s4411364s2516482s2071534s2074633s7856856s11957134s682333s9378200s1862626</p>
  
  <p>I also try sed $'s/\n//g' -i file1 and it doesn't work in mac os.</p>
  
  <p>Thank you. </p>