Subject: Re: bug#21218: ls -d

From: "Rainer M. Canavan" <[email-masked]>
Date: Sat, 8 Aug 2015 12:59:50 +0200 (CEST)

Eric Blake <[email-masked]> wrote:

[...]

> All -d does is to list command line arguments that are directories as
> the name of the directory itself, rather than descending and showing the
> directory's contents.

That description is already better than the current one in the
man page, which reads:

       -d, --directory
              list directory entries instead of contents, and do not  derefer-
              ence symbolic links

I'd say that one can reasonably be understood to mean that files would
not be listed, as Eddie did. I'd suggest a new wording:

       -d, --directory
              If an argument is a directory, list the directory itself 
              instead of its contents. Frequently used with -l to display
              the properties of directories.

I don't see any relevant effect on symbolic links, so unless soeone can
come up with an explanation, maybe that part can be dropped.

$ ls -ld b   
lrwxr-xr-x 1 canavan user 1 Aug  8 12:45 b -> a
$ ls -l b
lrwxr-xr-x 1 canavan user 1 Aug  8 12:45 b -> a
$ ls -d b
b
$ ls  b
b

rainer