title: Using command "ls -t | tail -n +4 | xargs rm --" to remove files in another location
body: <p>I have RaspBerry Pi project where A/D converter collects 5 minutes long data files into data folder and all data except newest one will be removed in every hour by dataFlush.py script and crontab. The path of dataFlush.py is "/home/pi" and the path of the data folder is "/home/pi/dataLog". So how do I add dataLog path into this command:</p>
  
  <pre><code>os.system('ls -t | tail -n +2 | xargs rm --')
  </code></pre>
  
  <p>I tried something like this but it didn't work:</p>
  
  <pre><code>os.system('ls /home/pi/dataLog -t | tail -n +2 | xargs rm --')
  </code></pre>