Skip to content

Instantly share code, notes, and snippets.

@gmunoz
Created August 26, 2016 15:13
Show Gist options
  • Save gmunoz/fef5cc2a67e5381690dd5649b148264a to your computer and use it in GitHub Desktop.
Save gmunoz/fef5cc2a67e5381690dd5649b148264a to your computer and use it in GitHub Desktop.
perl -nE '
$_{$_} = -M; # store file age (mtime - now)
END {
$, = "\n";
@sorted = sort {$_{$a} <=> $_{$b}} keys %_; # sort by increasing age
print @sorted[0..9];
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment