* SUMMARY: Date and Time for Files
@ 1998-04-13 16:06 malonsom
0 siblings, 0 replies; only message in thread
From: malonsom @ 1998-04-13 16:06 UTC (permalink / raw)
To: tru64-unix-managers
Thanks all that responsed my questions, this are the best solutions for my
problem
jerry@uclink.berkeley.edu Jerry Berkman, UC Berkeley
snkac@java.sois.alaska.edu Kurt Carlson University of Alaska
alan@nabeth.cxo.dec.com
stevev@hexadecimal.uoregon.edu
tpb@zk3.dec.com Dr. Thomas P. Blinn, UNIX Software Group
Marcelo Alonso M.
malonsom@villacero.com.mx
snkac@java.sois.alaska.edu con fecha 10/04/98 04:11:30 PM
Destinatarios: MARCELO ALONSO MONDRAGON/SICARTSA/VILLACERO
CC:
Asunto: Re: Date and Time for Files
>How I get full date and time of file ?
From:
ftp://raven.alaska.edu/pub/sois/README.uals
ftp://raven.alaska.edu/pub/sois/man.uals
kit: ftp://raven.alaska.edu/pub/sois/uals-v1.7.tar.Z
Example:
snkac@java: uals ~/.profile
- 0640 snkac users 1589 980404.1315 /users/sn/snkac/.profile
snkac@java: uals -e '%m/%d/%y %H%M%S' ~/.profile
- 0640 snkac users 1589 04/04/98 131526 /users/sn/snkac/.profile
kurt
_____________________________________________________________________
Kurt Carlson University of Alaska, ARSC snkac@java.sois.alaska.edu
(907)474-5763 910 Yukon Drive #108.84 Fairbanks, AK 99775-6200
jerry@uclink.berkeley.edu con fecha 10/04/98 03:08:37 PM
Destinatarios: MARCELO ALONSO MONDRAGON/SICARTSA/VILLACERO
CC:
Asunto: Re: Date and Time for Files
"ls" gives month, day and time for times in the last six months or so.
Here is a Perl script which gives eacttimes for a file:
#! /usr/local/bin/perl
while ( @ARGV ) {
print "\nfile $ARGV[0]\n";
@vec = stat( $ARGV[0] );
print "inode=$vec[1], ";
printf "mode=0%o, ", $vec[2] % 512;
print "nlinks=$vec[3], uid=$vec[4], gid=$vec[5], size=$vec[7]\n";
print "atime= "; &print_ts( $vec[8] );
print "mtime= "; &print_ts( $vec[9] );
print "ctime= "; &print_ts( $vec[10] );
sub print_ts {
local( $ts ) = @_ ;
@tv = localtime($ts);
printf "%2.2d:%2.2d:%2.2d ",
$tv[2], $tv[1], $tv[0];
printf "%2.2d %3s 19%2d\n",
$tv[3],
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")[$
tv[4]], $tv[5];
}
shift;
}
- Jerry Berkman, UC Berkeley
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1998-04-13 16:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-04-13 16:06 SUMMARY: Date and Time for Files malonsom
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox