I'm trying to remove all files found in a directory. The accepted answer to Delete Folder Contents in Python suggests getting a list of all files and calling "unlink" on them in a loop.
Suppose I have thousands of files on a network share, and want to tie up the directory for as short a time as possible.
Is it more efficient to delete them all using a shell command like rm -f /path/*
or by using shutils.rmtree
or some such?