Xref: feenix.metronet.com comp.unix.questions:6151
Newsgroups: comp.unix.questions
Path: feenix.metronet.com!news.ecn.bgu.edu!wupost!math.ohio-state.edu!cyber1.cyberstore.ca!van-bc!vanbc.wimsey.com!cs.ubc.ca!unixg.ubc.ca!kakwa.ucs.ualberta.ca!NoFC.Forestry.CA!dcarriga
From:
[email protected] (Dave Carrigan)
Subject: Re: How list full creation timestamp for file >6 months old?
Message-ID: <
[email protected]>
Organization: Northern Forestry Center, Northwest Region, Forestry Canada
References: <
[email protected]>
Date: Sun, 30 May 1993 21:15:41 GMT
Lines: 27
In <
[email protected]>
[email protected] (Bruce A. Hamilton) writes:
>This is REALLY basic, but "ls" doesn't do it, if I
>believe the SunOS 4.1.1 man pages. How to I list the
>FULL creation timestamp on a file >6 months old? (I also
>poked around in the "perl" camel book and didn't find
>anything.)
How about:
perl -e 'require "ctime.pl"; print &ctime((stat("filename"))[9])'
Example:
% ls -l rect
-rwxr-xr-x 1 dcarriga 57344 Jun 6 1992 rect*
% perl -e 'require "ctime.pl"; print &ctime((stat("rect"))[9])'
Sat Jun 6 16:59:32 1992
%
Note that this gives the modification time, not the creation time, which
is what ls(1) gives, at least on SunOS. If you want the modification time,
use [10]; for the access time use [8].
--
^
[email protected] /|\ Forestry Canada, Northwest Region
Dave Carrigan /|\ Northern Forestry Centre
(I speak for myself... | ...not for my employer!)