[Slugnet] How to sort files without a leading zero?

Darren Murphy darren at victoriajd.com
Tue Jan 13 12:26:50 SGT 2009


2009/1/13 P.V.Anthony <pvantony at singnet.com.sg>

> desire at gmail.com wrote:
>
> >     I need to sort these files.
> >
> >     access.log.12  access.log.19  access.log.6
> >     access.log.13  access.log.2   access.log.7
> >     access.log        access.log.14  access.log.20  access.log.8
> >     access.log.0      access.log.15  access.log.21  access.log.9
> >     access.log.1      access.log.16  access.log.3
> >     access.log.10     access.log.17  access.log.4
> >     access.log.11     access.log.18  access.log.5
> >
>

Given that it's quite likely that there is a correlation between the
filename and the file ctime, you could of course just use /bin/ls

ls -lct access.log*
or
ls -lctr acces.log*  (to reverse the sort)

cheers,
Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lugs.org.sg/pipermail/slugnet/attachments/20090113/ec67aa3a/attachment.html


More information about the Slugnet mailing list