The man page doesn't explain this format conflict, while the info page (info '(coreutils) ls invocation' or 'info ls') claims '-f' implies '-1' which is also incorrect: 'ls -1f' gives different output to to 'ls -f'.

I am using coreutils 9.4-3 in Manjaro and the online documentation for 9.5 <https://www.gnu.org/software/coreutils/manual/html_node/Sorting-the-output.html> seems to to be only document consistent with actual 9.4 behavior ('-f'  implies '-aU' and disables '-l'), Technically then these are errors in the man and info pages, but I think it is misleading to have what is described as a 'sort option'  determining output format. If the option was described correctly in the man and info documents installed with the software that would be some improvement. Hopefully 9.5 fixes these bugs.

Toby

On 16/04/2024 16:53, Chris Elvidge wrote:


On 16/04/2024 at 16:07, Toby Kelsey wrote:
There appears to be a bug with 'ls' when using the '-f' and '-l' options, or at least an inconsistency with the man page. The man page says '-f' list entries in directory order and does not mention any incompatibilities with other options, however I find using it with the '-l' option gives different ouputs depending on the order of options. See the following script log for an example:


It really says -f = do not sort, enable -aU. -U = do not sort

It also says -f = disable -ls --color

So -l -f = -f takes precedence, -f -l = -l takes precedence.





Reply via email to