11-08-05 11:29 PM
>Anyway to grab a file's timestamp (date, time, seconds) using straight
>Unix Shell commands or ksh bultin? (not GNU, not perl, not C)
Yes. If you don't need the time down to the second, you can parse
the output of "ls -l". Otherwise you can use the BSD program "stat",
if you consider that standard enough. You can get any time format
strftime() will give to you.
% stat -f "%Sm" .
Nov 8 00:59:08 2005
% stat -f "%Sm" -t "%Y%m%d%H%M%S" .
20051108005908
%
Instead of m (modification time), you can use a (access time) or
c (inode change time).
Gordon L. Burditt
[ Post a follow-up to this message ]
|