The bin utility 'ls' does not conform to Posix standards. Specially the options g, n and o. SHORT DESCIPTIONS from Posix: -g "The same as -l, except that the owner shall not be written." -n "The same as -l, except that the owner's UID and GID numbers shall be written , rather than the associated character strings." -o "The same as -l, except that the group shall not be written." Current Desciption from freebsd, man page: man ls Please note that, in the manpage for ls, the -n option is currect, however the l s utility doesn't actually follow the rule. Also currently, the -o options is used to show the file flags. With my included patch, I changed it to '-O', but I'm sure you guys would want to keep some comp atibility somewhere. I just wasn't sure how you guys wanted to implement this, so I arbitrarily picked an unused letter. Fix: http://hostsentry.net/ls.diff How-To-Repeat: ls -g ls -n ls -o
Please note that the -g, -n and -o options are XSI extensions, and that FreeBSD generally favours traditional BSD behaviour over System V behaviour where conflicts exist. Tim
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
https://reviews.freebsd.org/D34747 Phabricator link
Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3bfbb521fef5764ecabc2bf3fdc76f47258171f8 commit 3bfbb521fef5764ecabc2bf3fdc76f47258171f8 Author: Minsoo Choo <minsoochoo0122@proton.me> AuthorDate: 2023-07-18 16:49:59 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2023-07-18 17:03:09 +0000 ls: Improve POSIX compatibility for -g and -n. - Change -g (ignored for BSD 4.3 compatibility since BSD 4.4) to use POSIX semantics of implying -l but omitting the owner's name. - Change -n to imply -l. The -o option remains unchanged (POSIX defines -o as a complement to -g that implies -l but omits group names whereas BSD defines -o to add file flags to -l). This compromise is the same used by both NetBSD and OpenBSD. PR: 70813 Reviewed by: jhb, Pau Amma <pauamma@gundo.com> Co-authored-by: John Baldwin <jhb@FreeBSD.org> Differential Revision: https://reviews.freebsd.org/D34747 bin/ls/ls.1 | 11 +++-------- bin/ls/ls.c | 10 +++++++++- bin/ls/ls.h | 1 + bin/ls/print.c | 8 +++++--- bin/ls/tests/ls_tests.sh | 19 ++++++++++--------- 5 files changed, 28 insertions(+), 21 deletions(-)
^Triage: * assign to the resolving committer * CC the former assignee * summary, URL, status, keywords, flags.
This was merged to main prior to stable/14 branching, so is already present in stable/14 (no need to merge there). Given that it does change the behavior of existing flags to a commonly-used command (albeit only slightly), I don't think it's worth merging to older branches.