title: rails - Redirecting console output to a file
body: <p>On a bash console, if I do this:</p>
  
  <pre><code>cd mydir
  ls -l &gt; mydir.txt
  </code></pre>
  
  <p>The > operator captures the standard input and redirects it to a file; so I get the listing of files in <code>mydir.txt</code> instead of in the standard output.</p>
  
  <p>Is there any way to do something similar on the rails console?</p>
  
  <p>I've got a ruby statement that generates lots of prints (~8k lines) and I'd like to be able to see it completely, but the console only "remembers" the last 1024 lines or so. So I thought about redirecting to a file - If anyone knows a better option, I'm all ears.</p>