Is there a unix (solaris) command that will return JUST the time and date
stamp of a file. I hate parsing things out of 'ls'.
You need to stat(2) the file and look at the appropriate
perl would be the quickest scriptable solution to this
(why isn't there a stat(1) in Solaris?)
e.g. modification time of /etc/passwd:
my $s = stat('/etc/passwd');
print scalar localtime($s->mtime), "\n";
Yes way! Mmmmkay?
> > Is there a unix (solaris) command that will return JUST the time and date
> > stamp of a file. I hate parsing things out of 'ls'.
> Yes, you can:
> touch -t 199906042020 filename #date stamp
Well, maybe I don't know how our sys admin installs it. :^)FYI, I'm using
> man touch
touch [-acm] [-r ref_file] file...
touch [-acm] [-t time] file...
touch [-acm] [date_time] file...
> touch -t 01011200 MyFile
usage: touch [-amcf] file ...
> which touch
> man -s 1b touch
/usr/ucb/touch [-acfm] file...Obviously, my "touch" command and its
manpage don't match. :^(
Which is the default "touch" in Solaris 2.5.1? Where can I get the "touch"
for Solaris 2.5.1 that allows me to set a specific time/date stamp, as
described in the manpage?