PERL
Use the following command to find the age
of a file:
$ perl -e '$mtime = (stat($ARGV[0]))[9]; $age = ($mtime) ? time - $mtime : -1; print "$age\n";' file_name
For example:
$ perl -e '$mtime = (stat($ARGV[0]))[9]; $age = ($mtime) ? time - $mtime : -1; print "$age\n";' /etc/passwd
will return the number of seconds passed since /etc/passwd
was updated.
Perl Scripts
For more examples, look at the following pages which contain some Perl scripts that may prove useful to you. Generally, these scripts will run both on UNIX and Windows environments.