Skip to content

Instantly share code, notes, and snippets.

@gmunoz
Created August 26, 2016 15:14
Show Gist options
  • Save gmunoz/d72cf2300709a7f50f2416629d91ecdc to your computer and use it in GitHub Desktop.
Save gmunoz/d72cf2300709a7f50f2416629d91ecdc 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