I have standard ls installed, I also have lsd installed, which is a nerd-font drop-in replacement for ls. I mention this because the error may have something to do with the alias.
For testing right now, I have alias ls=ls
in place to remove any of my custom commands.
If I type ls
in the /etc directory, where there are obviously several subfolders (which you can see without the -d flag), I get the following:
>>>root@Unraid:/etc# ls -d /
/
>>>root@Unraid:/etc# ls -d
.
>>>root@Unraid:/etc# lsd -d
📂 ./
>>>root@Unraid:/etc# lsd -d /
📂 //
the missing codepoint is just a folder 📂 icon. I replaced all the boxes with browser compatible emojis just for clarity. LSD has been installed for a few days and isn't the issue. They behave identically.
I prefixed the prompt lines with >>>
just to make them easier to pick out.
Let's use my home directory as an example. The correct response is that there are 2 folders in ~
, lsd
and pkg
>>>root@Unraid:~# lsd
📂 lsd/ 📂 pkg/ 📃 appdataUNRAID.code-workspace@ 📄 mdcmd@
>>>root@Unraid:~# ls -F
appdataUNRAID.code-workspace@ lsd/ mdcmd@ pkg/
>>>root@Unraid:~# lsd -F
📂 lsd/ 📂 pkg/ 📃 appdataUNRAID.code-workspace@ 📄 mdcmd@
>>>root@Unraid:~# ls
appdataUNRAID.code-workspace lsd mdcmd pkg
>>>root@Unraid:~# ls -lhp
total 0
lrwxrwxrwx 1 root root 30 Mar 14 16:41 appdataUNRAID.code-workspace -> ./appdataUNRAID.code-workspace
drwxrwxrwx 3 root root 140 Mar 18 11:35 lsd/
lrwxrwxrwx 1 root root 21 Mar 13 18:55 mdcmd -> /usr/local/sbin/mdcmd
drwxrwxrwx 2 root root 140 Mar 24 10:10 pkg/
Again these icons are missing here, but the single directory in here "lsd" has the correct folder icon. Both these commands take appropriate flags.
Here we can see that they take flags just fine, and they find the two directories perfectly fine, but TWO implementations of ls
only return the .
directory on the -d flag, even when combined with other flags.
>>> root@Unraid:~# lsd -d
📂 ./
root@Unraid:~# ls -dFl
drwx--x--- 11 root root 420 Mar 24 10:10 ./
## The full text flag also doesn't work.
root@Unraid:~# ls --directory
.
It doesn't matter what other flags are in place, if the D flag is in then two separate implementations of ls
only show the current directory .
,
I mean, it doesn't even show the default ..
2nd directory that's there. I tried adding recursion as well.
What's happening?
-d
option withls
. It's also unclear what you think the use of this option is.ls -d */
, perhaps not.which
...which ls