Created
April 22, 2021 02:55
-
-
Save zackramjan/f28586d0783dcd4c8389cc1d2c1d96d9 to your computer and use it in GitHub Desktop.
report on file stats from list on stdin
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
#!/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