Date: Sun, 16 Aug 2015 15:27:36 +0200 From: Polytropon <freebsd@edvax.de> To: "Dr. Andreas Haakh" <bugReporter@ib-haakh.de> Cc: Paul Smith <paul.j.smith0@gmail.com>, FreeBSD Questions <freebsd-questions@freebsd.org> Subject: Re: a bug in /bin/ls Message-ID: <20150816152736.f04eeb17.freebsd@edvax.de> In-Reply-To: <55D08CA3.7050306@ib-haakh.de> References: <55CD23C7.9010803@ib-haakh.de> <CACoaAtPak43P9N%2BhcjXWAm2rdFAA5Z8NXAnaxxTcvy5Lxod4fQ@mail.gmail.com> <55D08CA3.7050306@ib-haakh.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 16 Aug 2015 15:14:11 +0200, Dr. Andreas Haakh wrote: > Am 14.08.2015 um 05:26 schrieb Paul Smith: > > On Thu, Aug 13, 2015 at 5:09 PM, Dr. Andreas Haakh > > <bugReporter@ib-haakh.de> wrote: > >> On: > >> FreeBSD Crabberio.Haakh.de 10.2-PRERELEASE FreeBSD 10.2-PRERELEASE #0 > >> r286580: Mon Aug 10 19:49:05 CEST 2015 > >> toor@Crabberio.Haakh.de:/usr/obj/usr/src/sys/CRABBERIO amd64 > >> > >> using the "-U"-flag in /bin/ls together with "-l" > >> leads to the following output > >> [...] > >> -rwxr--r-- 1 krabbe ibh 798720 1 Jan 1970 IMAG1562.jpg > >> -rw-r--r-- 1 krabbe ibh 579493 1 Jan 1970 IMAG1714.jpg > >> [...] > >> > >> and the sorting is not affected by the flag (still by name). > >> > >> > > > > >From the man page: > > > > -U Use time when file was created for sorting or printing. > > > > -u Use time of last access, instead of time of last modification > > of the file for sorting (-t) or printing (-l). > > > > -t Sort by descending time modified (most recently modified first). . . . > > > > Does something like ls -Ult give you what you want? My interpretation > > is that -u and -U need to be combined with -t or -l. > > > > I think the -c option works the same way. > > Did you get different output on a previous FreeBSD version? > > > > Paul > -Ult returns Jan 1st 1970 as well. Even with actually different dates (verified with "stat"), the date sorting options don't seem to have an effect. I have verified this even on a not-so-recent version of FreeBSD. The only "solution" would be to do something like this: % ls -laF -D "%Y-%m-%d_%H:%M:%S" | sort +5 But that's not what one _should_ have to do, given that there are date sorting options mentioned in the "ls" manual... -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150816152736.f04eeb17.freebsd>