a bug in /bin/ls

Polytropon freebsd at edvax.de
Fri Aug 14 00:13:13 UTC 2015


On Fri, 14 Aug 2015 02:01:41 +0200, Dr. Andreas Haakh wrote:
> My example comes from an nfs-mounted ufs-filesystem -- the server is
> 
> FreeBSD abaton 9.3-STABLE FreeBSD 9.3-STABLE #0 r284539: Thu Jun 18
> 12:55:12 CEST 2015     toor at abaton:/usr/obj/usr/src/sys/ABATON  amd64
> 
> mount on my server gives (among others)
> /dev/mirror/gm0p1 on /datM (ufs, NFS exported, local, nfsv4acls) <---
> this one
> /dev/mirror/gm0p2 on /datV (ufs, NFS exported, local)
> /arr0/mmed on /mmed (zfs, NFS exported, local, nfsv4acls)
> 
> The second fs (without nfsv4acls) and the last one (zfs) give me the
> same results.

I can confirm this.



> The lowercase variant of the options "-u" gives a real date but ordering
> doesn't work either.

You can always verify the three dates with "stat <filename(s)>",
or use "stat *" for comparison. You can also use a strftime()-like
format string for "pretty printing":

% stat -t "%Y-%m-%d %H:%M:%S" *
107 62979017 -rw-r--r-- 1 poly staff 0 0 "2015-08-14 01:25:35" "2015-08-14 01:25:35" "2015-08-14 01:25:35" "2015-08-14 01:25:35" 16384 0 0 a
107 62979021 -rw-r--r-- 1 poly staff 0 0 "2015-08-14 01:25:41" "2015-08-14 01:25:41" "2015-08-14 01:25:41" "2015-08-14 01:25:41" 16384 0 0 b
107 62979018 -rw-r--r-- 1 poly staff 0 0 "2015-08-14 01:25:38" "2015-08-14 01:25:38" "2015-08-14 01:25:38" "2015-08-14 01:25:38" 16384 0 0 c

Even though those have different date information, using the
-c, -u or -U option does always result in alphabetic ordering.
This happens on a locally mounted UFS file system. The mount
options here do not involve anything special:

/dev/ad6 on /home (ufs, local, soft-updates)

So those should not be the source of the problem.



> N.B.: Senile Bettflucht ;-) ??

No, just "commonly unacceptable working hours". ;-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list