1753936 Members
10364 Online
108811 Solutions
New Discussion юеВ

time stamp on files

 
SOLVED
Go to solution
Tammy Liang
Regular Advisor

time stamp on files

How can I see the time stamp on files to seconds?
ll command only shows hour and minutes.

Thanks for any help
take easy, enjoy life
4 REPLIES 4
Ramkumar Devanathan
Honored Contributor

Re: time stamp on files

Hi,

Use fstat - available free for hp-ux from this site -

http://hpux.cs.utah.edu/ftp/hpux/Shells/fstat-1.0/fstat-1.0-sd-11.00.depot.gz

Depot for HP-UX 10.20 is also available here.

run as below -

# /opt/fstat/bin/fstat %a
README
1068057404
^D
#

%a is the format string to get access time in seconds. other options are available - see /opt/fstat/doc/README after you install the above depot.

HTH.
- ramd.
HPE Software Rocks!
James A. Donovan
Honored Contributor

Re: time stamp on files

The ls command wont do it, but perl will.

perl -e 'foreach(@ARGV){$t =localtime ( ( ( stat ( $_ ) ) [9] ) ); printf("%-20s%s\n",$_,$t);}' *
Remember, wherever you go, there you are...
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: time stamp on files

Here is a perl script that will do it:

ftimes.pl -m file1 file2 will display mtime; ftimes -c will display ctimes; ftimes.pl -a will display time of last access; if you also add a -e option the timestamp in epoch seconds will be displayed.

If it ain't broke, I can fix that.
john korterman
Honored Contributor

Re: time stamp on files

Hi,
an old cpio-trick:

# echo |cpio -o 2>/dev/null|cpio -ivt 2>/dev/null

regards,
John K.
it would be nice if you always got a second chance