Skip to content

Instantly share code, notes, and snippets.

@zackramjan
Created April 22, 2021 02:55
Show Gist options
  • Save zackramjan/f28586d0783dcd4c8389cc1d2c1d96d9 to your computer and use it in GitHub Desktop.
Save zackramjan/f28586d0783dcd4c8389cc1d2c1d96d9 to your computer and use it in GitHub Desktop.
report on file stats from list on stdin
#!/usr/bin/perl
use POSIX qw(strftime);
use strict;
while(<>)
{
chomp;
$_ =~ s/\\/\//g;
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = stat("/varidata/research/$_");
print "/varidata/research/$_\t$uid\t" . strftime("%m/%d/%Y %H:%M:%S",localtime($atime)) . "\t". strftime("%m/%d/%Y %H:%M:%S",localtime($mtime)) . "\t$size\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment