in reply to Quickest way to get the oldest file
It will take a little memory, but it cracks on a bit :)
#! perl -slw use strict; use List::Util qw[ reduce ]; die 'Usage: $o <dir>' unless @ARGV >0; print reduce{ -C $a > -C $b ? $a : $b } glob for @ARGV;
Or as a one-liner
perl -MList::Util=reduce -le"print reduce{-C $a>-C $b?$a:$b}glob for @ +ARGV;" cache/*/*/*/*
Caveat: Will need adjustments for *nix.
|
|---|