GNU bug report logs -
#70418
ls bug
Previous Next
Full log
View this message in rfc822 format
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:
toby <at> toby-pc:/tmp$ mkdir test
toby <at> toby-pc:/tmp$ cd test
toby <at> toby-pc:/tmp/test$ touch c b a foo bar
toby <at> toby-pc:/tmp/test$ ls -lf
. .. c b a foo bar
toby <at> toby-pc:/tmp/test$ ls -fl
total 0
drwxr-xr-x 2 toby toby 140 Apr 16 15:50 .
drwxrwxrwt 18 root root 560 Apr 16 15:50 ..
-rw-r--r-- 1 toby toby 0 Apr 16 15:50 c
-rw-r--r-- 1 toby toby 0 Apr 16 15:50 b
-rw-r--r-- 1 toby toby 0 Apr 16 15:50 a
-rw-r--r-- 1 toby toby 0 Apr 16 15:50 foo
-rw-r--r-- 1 toby toby 0 Apr 16 15:50 bar
toby <at> toby-pc:/tmp/test$ ls -l -f
. .. c b a foo bar
toby <at> toby-pc:/tmp/test$ ls -f -l
total 0
drwxr-xr-x 2 toby toby 140 Apr 16 15:50 .
drwxrwxrwt 18 root root 600 Apr 16 15:57 ..
-rw-r--r-- 1 toby toby 0 Apr 16 15:50 c
-rw-r--r-- 1 toby toby 0 Apr 16 15:50 b
-rw-r--r-- 1 toby toby 0 Apr 16 15:50 a
-rw-r--r-- 1 toby toby 0 Apr 16 15:50 foo
-rw-r--r-- 1 toby toby 0 Apr 16 15:50 bar
toby <at> toby-pc:/tmp/test$ type ls
ls is /usr/bin/ls
toby <at> toby-pc:/tmp/test$ ls --version
ls (GNU coreutils) 9.4
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Richard M. Stallman and David MacKenzie.
Regards,
Toby
This bug report was last modified 1 year and 30 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.