title: unable to capture top command output in a file using watch command
body: <p>I'm trying to write the output of a <code>top</code> command to a file, but it's not working. </p>
  
  <p>Command I am trying:</p>
  
  <pre><code>watch -n 5 'top -p 4448 &gt; /directorypath/filename.txt'
  </code></pre>
  
  <p>If I run only the <code>top</code> command without <code>watch</code> it works.</p>