Created
June 6, 2019 09:38
-
-
Save fskale/ad4e9f7e73418d1c5f70a11616c3fc74 to your computer and use it in GitHub Desktop.
Mojo oneliner to find files that were modified e.g. < 1 week (depth 2 subdirs) and print the the modification time and and the age in seconds !
This file contains 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 -E 'use Mojo::File "path"; use Cwd "cwd"; my $cwd=cwd(); say path(qq{$cwd})->list_tree({dir => 0, max_depth => 3})->map( sub { my $mtime = path($_)->lstat->mtime; time() - $mtime < 86400 ? sprintf("%s %d %d", $_, path($_)->lstat->mtime, time() - $mtime ) : undef;})->compact->join("\n");' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment