Skip to content

Instantly share code, notes, and snippets.

@fskale
Created June 6, 2019 09:38
Show Gist options
  • Save fskale/ad4e9f7e73418d1c5f70a11616c3fc74 to your computer and use it in GitHub Desktop.
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 !
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