From: Toby Kelsey <toby.kelsey@gmail.com>
To: 70418@debbugs.gnu.org
Subject: bug#70418: ls bug
Date: Tue, 16 Apr 2024 16:07:59 +0100 [thread overview]
Message-ID: <016cc2a1-0759-4ac9-85a3-a9998129e1cc@gmail.com> (raw)
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@toby-pc:/tmp$ mkdir test
toby@toby-pc:/tmp$ cd test
toby@toby-pc:/tmp/test$ touch c b a foo bar
toby@toby-pc:/tmp/test$ ls -lf
. .. c b a foo bar
toby@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@toby-pc:/tmp/test$ ls -l -f
. .. c b a foo bar
toby@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@toby-pc:/tmp/test$ type ls
ls is /usr/bin/ls
toby@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
next reply other threads:[~2024-04-16 15:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-16 15:07 Toby Kelsey [this message]
2024-04-16 15:53 ` bug#70418: ls bug Chris Elvidge
2024-04-16 21:30 ` Toby Kelsey
2024-04-16 22:17 ` Paul Eggert
2024-04-16 22:53 ` Chris Elvidge
2024-04-17 10:19 ` Pádraig Brady
2024-04-17 21:43 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-coreutils
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=016cc2a1-0759-4ac9-85a3-a9998129e1cc@gmail.com \
--to=toby.kelsey@gmail.com \
--cc=70418@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).