GNU bug report logs -
#14189
ls -d bug ??
Previous Next
Full log
View this message in rfc822 format
Hello Ray,
Others can provide more detailed information about the rational of the "dot" file,
but regarding your questions:
ray <at> electronicstheory.com wrote, On 04/11/2013 02:17 PM:
> Once in a blue moon, a person would like to view the subdirectories of the
> directory you are in, without seeing all the various files.
"find -type d" will list all directories (but will do so recursively).
"find -maxdepth 1 -type d" will list only directories immediately under your current directory.
Since it's "once in a blue moon" (as you've said), I guess there's no "short form" for that.
If you need the extended information that "ls" provides:
find -maxdepth 1 -type d -print0 | xargs -0 ls -ld
<...>
>
> Interestingly, the MAN page seems to indicate that this is the way to go,
> however, regardless of what directory you are in, if you type
>
> ls -d
>
One use-case for "-d" is to show the information about the directory, instead of the *content* of the directory.
Compare:
ls -l /etc
vs.:
ls -ld /etc
HTH,
-gordon
This bug report was last modified 12 years and 96 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.