title: Deleting large numbers of files in python
body: <p>I'm trying to remove all files found in a directory.  The accepted answer to <a href="https://stackoverflow.com/questions/185936/delete-folder-contents-in-python">Delete Folder Contents in Python</a> suggests getting a list of all files and calling "unlink" on them in a loop.</p>
  
  <p>Suppose I have thousands of files on a network share, and want to tie up the directory for as short a time as possible.</p>
  
  <p>Is it more efficient to delete them all using a shell command like <code>rm -f /path/*</code> or by using <code>shutils.rmtree</code> or some such?</p>