ls -U don't work?

Kevin Oberman rkoberman at gmail.com
Sat Jul 13 16:20:39 UTC 2013


On Sat, Jul 13, 2013 at 3:30 AM, Alex V. Petrov <alexvpetrov at gmail.com>wrote:

> В письме от 13 июля 2013 13:45:30 Вы написали:
> > 2013/7/13 Alex V. Petrov <alexvpetrov at gmail.com>:
> > > subj:
> > > ls -Ul
> >
> > So, what's the problem? Looking at code,
> > I'd suggest to try adding -t to actually enable sorting,
> > otherwise it just prints dates but not sorts.
> >
> > > total 0
> > > -rw-r--r--  1 alex  alex  0 13 июл 15:26 000
> > > -rw-r--r--  1 alex  alex  0 13 июл 15:25 111
> > > -rw-r--r--  1 alex  alex  0 13 июл 15:25 222
> > > -rw-r--r--  1 alex  alex  0 13 июл 15:25 333
> >
> > -t enables sorting (by modified date by default),
> > -U further specifies to sort by birth time.
>
> What is the meaning of '-U'?I thought '-U' = '-tr'
>
> man ls:
> "-U      Use time when file was created for sorting or printing."
>
> -----
> Alex V. Petrov
>

No, '-U' tells ls(1) to use ctime for all timestamps. By default it uses
mtime. So 'ls -U' will print ctime, but to sort by ctime you need 'ls -Ut'
or 'ls -Utr'.
-- 
R. Kevin Oberman, Network Engineer
E-mail: rkoberman at gmail.com


More information about the freebsd-stable mailing list