[ale] HOW2 filter a directory of file names... by DATE... ?

Robert Story rstory-l at 2006.revelstone.com
Tue Mar 14 06:48:53 EST 2006


On Mon, 13 Mar 2006 23:22:49 -0500 Pete wrote:
PH> On 3/13/06, Courtney Thomas <cc.thomas at earthlink.net> wrote:
PH> > That is, I want to delete files of a certain date from a directory.
PH> 
PH> find may do the trick
PH> find <dir> -cmin <xmin> -exec rm \;

If you are expecting to find lots of files, a more efficient version:

  find <dir> -cmin <xmin> -print | xargs -r rm

and if file name may contain spaces

  find <dir> -cmin <xmin> -print0 | xargs -0 -r rm



More information about the Ale mailing list