From: Geoff Clare on
Chris Mattern wrote:

> On 2008-05-02, Ed Morton <morton(a)lsupcaemnt.com> wrote:
>>
>> You can use last access time or last modification time,
>> you just can't use creation time.
>>
> There's also change time; if they're not changing around permissions or
> ownerships, or using hard links to the file, it can be used as a proxy
> for creation time.

No it can't. The ctime is also updated when the file is written to.

--
Geoff Clare <netnews(a)gclare.org.uk>
From: Scott McMillan on
On Fri, 2 May 2008 15:35:44 -0700 (PDT), apogeusistemas(a)gmail.com
wrote:

<snip>

>
>I create this script, but it's removing last modified files, but I
>want exactly the opposite.
>
>ls -ltr *.trw | tail +15 | awk '{ print $9 }' > x.lis
>for file in `cat x.lis`
>do
>ls -l $file
>#rm $file
>done
>
>
>issuing ls -ltr I get this ->
>
>ls -ltr *.trw
>
>-rw-r----- 1 oradm dba 25085423 May 2 09:51
>dm581_ora_10744.trw
>-rw-r----- 1 oradm dba 25085487 May 2 09:51
>dm789_ora_10742.trw
>-rw-r----- 1 oradm dba 790 May 2 10:03
>dm532_reco_27372.trw
>-rw-r----- 1 oradm dba 862 May 2 10:11
>dm351_ora_10969.trw
>-rw-r----- 1 oradm dba 25240999 May 2 10:21
>dm676_ora_10881.trw
>-rw-r----- 1 oradm dba 25240991 May 2 10:21
>dm321_ora_10879.trw
>-rw-rw---- 1 oradm dba 755 May 2 10:37
>dm143_ora_3295.trw
>-rw-rw---- 1 oradm dba 753 May 2 10:37
>dm989_ora_3254.trw

As expected. You told ls to reverse the order when you supplied the -r
option...

>
>but I need any ls command to show me this ->
>
>-rw-rw---- 1 oradm dba 753 May 2 10:37
>dm989_ora_3254.trw
>-rw-rw---- 1 oradm dba 755 May 2 10:37
>dm143_ora_3295.trw
>-rw-r----- 1 oradm dba 25240991 May 2 10:21
>dm321_ora_10879.trw
>-rw-r----- 1 oradm dba 25240999 May 2 10:21
>dm676_ora_10881.trw
>-rw-r----- 1 oradm dba 862 May 2 10:11
>dm351_ora_10969.trw
>-rw-r----- 1 oradm dba 790 May 2 10:03
>dm532_reco_27372.trw
>-rw-r----- 1 oradm dba 25085487 May 2 09:51
>dm789_ora_10742.trw
>-rw-r----- 1 oradm dba 25085423 May 2 09:51
>dm581_ora_10744.trw

Then remove the -r option, as in ls -lt


Scott McMillan