Last active
January 3, 2019 21:01
-
-
Save BrianRossmajer/f3c01ad2eff1dc23f17fc9b5c3de2df8 to your computer and use it in GitHub Desktop.
Find the newest file in a subdirectory tree
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -MFile::Find -e 'sub w{my $t=(stat _)[9];if ( -f _ && $t>$newest){ $newest=$t;$file=$File::Find::name;}} find(\&w,(shift or ".")); print $file," ",$newest;' <dir> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment