From: malonsom () villacero ! villacero ! com ! mx
To: tru64-unix-managers
Subject: SUMMARY: Date and Time for Files
Date: Mon, 13 Apr 1998 16:06:19 +0000 [thread overview]
Message-ID: <96078705511490.tru64-unix-managers.marc@archive.invalid> (raw)
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
reply other threads:[~1998-04-13 16:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox