How do I find the file creation date with out using ls and cut commands ?

Hi How do I find the file creation date with out using ls and cut commands ?for example:%filecrdate <name_of the_file>2007-03-04
[169 byte] By [sivaparama] at [2007-11-27 9:36:03]
# 1

What files are you referring to?

Traditionally, UNIX files do not have a creation date. UFS on Solaris doesn't record or track any creation timestamp.

The timestamps on UNIX are access time, modification time, and inode change time.

You can grab and compile the 'stat' program to see them easily, or I might use 'perl' to view them.

# stat field 8 is atime, 9 is mtime, and 10 is ctime

%perl -le 'print scalar localtime ((lstat $ARGV[0])[9])' <name_of_the_file>

If you truly just want the date in that format, I'd go with:

% perl -MPOSIX -le 'print strftime "%Y-%m-%d",localtime ((stat $ARGV[0])[9])' <name_of_the_file>

--

Darren

Darren_Dunhama at 2007-7-12 23:04:15 > top of Java-index,Solaris Operating System,Solaris 10 Features...