[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: The ls command



On Thu, Oct 30, 2025 at 9:54 PM David <bouncingcats@gmail.com> wrote:
> On Fri, 31 Oct 2025 at 03:44, Greg Wooledge <greg@wooledge.org> wrote:
> > On Fri, Oct 31, 2025 at 04:26:06 +0100, Vincent Lefevre wrote:
> > This whole thread is insane.
> True.

What I find puzzling, though, we have from OP:
] I have a Debian 12 setup running on a desktop PC.
] I am trying to list my PDF files using the ls command.
] I ran
] ls  *.pdf
] and received the error message
] Invalid option '--K'
] No files were listed.
and subsequently:
]] Also, alias ls = ls -CF
However, testing on Debian 12 I can't come close to that behavior.
So, I wonder if OP isn't on Debian 12,
and/or OP isn't (via the alias) using ls from coreutils.
Notably on Debian 12 and using the ls from coreutils,
and with or without such an alias, I can easily get results like:
$ ls *.pdf
ls: unrecognized option '--K.pdf'
Try 'ls --help' for more information.
$
Notably I'm unable to find a way to, as OP presumably invoked,
get ls from coreutils to complain about option '--K',
but rather only the name of the file (interpreted as option)
starting with --K and ending with .pdf extension.
Also, the diagnostic is also quite different - "Invalid option" vs.
"unrecognized option".  I don't know if there's any language/locale setting
that could be changed to get it to match what OP reported,
and even if that were to match, I doubt that would change the
reporting from '--K' to '--Kfilename_ending_in_.pdf' or vice versa.
So, not sure what might cause that.  Maybe OP is using an atypical
shell that, e.g. further splits after * matching, but then would also
still need to account for the differences in the wording of the diagnostic.
Perhaps OP isn't even running Debian at all, or misreported the diagnostic?


Reply to: