title: How to redirect output of an already running process
body: <p>Normally I would start a command like </p>
  
  <pre><code>longcommand &amp;;
  </code></pre>
  
  <p>I know you can redirect it by doing something like</p>
  
  <pre><code>longcommand &gt; /dev/null;
  </code></pre>
  
  <p>for instance to get rid of the output or</p>
  
  <pre><code>longcommand 2&gt;&amp;1 &gt; output.log
  </code></pre>
  
  <p>to capture output.</p>
  
  <p>But I sometimes forget, and was wondering if there is a way to capture or redirect after the fact.</p>
  
  <pre><code>longcommand
  ctrl-z
  bg 2&gt;&amp;1 &gt; /dev/null
  </code></pre>
  
  <p>or something like that so I can continue using the terminal without messages popping up on the terminal.</p>