title: How to redirect the output of "ls-ltr | grep *.txt | cut -1 " to a list in Python
body: <p>its a fundamental on Linux.I need to redirect the the output of the following to a file or list.</p>
  
  <pre><code>cmd="ls-ltr | grep *.txt | cut -1 "
  </code></pre>
  
  <p>My Code is something like this:</p>
  
  <pre><code>#!/usr/bin/python
  
  import os
  
  path='/opt/dsoren/'
  os.system('ls-ltr | grep *.txt | cut -1 &gt; /dest_path/abc.txt')
  </code></pre>
  
  <p>Any help or insight is highly appreciated.</p>