POSIX conformance of ls -l -1

David Schultz das at FreeBSD.ORG
Sun Mar 22 09:57:13 PDT 2009

On Sun, Mar 22, 2009, Mikoláš Janota wrote:
> For the command ls, the POSIX standard, says that "When -l (ell) is
> specified, -1 (one) shall be assumed."
> (http://www.opengroup.org/onlinepubs/000095399/utilities/ls.html)
> In the FreeBSD implementation, however, -1 and -l override one
> another. I can't see how this could be POSIX compliant.
> I'm on Mac OS X which I believe is using FreeBSD port and the man page
> claims POSIX compliance. Where can I find more information about this?

Perhaps it's a bug. Comments in the source seem to indicate that
it was done this way on purpose, though. If you have `ls' aliased
to `ls -laG', for example, you can still use `ls -1' on the command
line to force the single-line output (as if the options were `ls -aG'.)
I'm not sure what we ought to do about it.

More information about the freebsd-standards mailing list