in reply to Re: find "x" quantity newest files in a dir
in thread find "x" quantity newest files in a dir

Or just:
find . -type f | perl -nle 'print -M, "\t$_"' | sort -n | \ + tail +10 | cut -f 2 | xargs rm
This assumes there are no filenames with newlines in them.

-- Abigail

Replies are listed 'Best First'.
Re: Re: find "x" quantity newest files in a dir
by thatguy (Parson) on Jun 28, 2001 at 04:44 UTC
    hmm.. well, dang. mine started out so small!

    I am only now begining to see the fine art of perl and I think it's going to be a long time before I get away from the bludgeoning I do now.