Filestamps in Korn Shell

Hi everybody,

Does anyone know how to get the timestamp of a file in eposh format in Korn Shell?? any suggestions would be highly appreciated:)

Thanx in advance:b:

nothing in the basic ksh toolset...however, to paraphrase the following site Solaris Jedi: Solaris Date command and epoch time:

truss date 2>&1 |grep ^time |awk '{print $3;}' 
1 Like

GNU stat:

stat --printf="%X\n" infile

Perl:

perl -le'print+(stat shift)[8]' infile

---------- Post updated at 09:31 PM ---------- Previous update was at 09:13 PM ----------

I thought the OP wanted the file modification time.

truss -f -v 'lstat,lstat64' ls -d file 2>&1 | grep 't ='

---------- Post updated 11-05-10 at 22:21 ---------- Previous update was 10-05-10 at 23:36 ----------

Putting omoyne PM back on this thread:

They aren't timezones, EDT is a timezone.
at: last access time
mt: last data modified time
ct: last file status change time

truss -f -v 'lstat,lstat64' ls -d file 2>&1 | grep 'ct =' | nawk '{print $10}'