bug-coreutils
[Top][All Lists]
Advanced

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

bug#14189: ls -d bug ??


From: Assaf Gordon
Subject: bug#14189: ls -d bug ??
Date: Thu, 11 Apr 2013 16:56:16 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120510 Icedove/10.0.4

Hello Ray,

Others can provide more detailed information about the rational of the "dot" 
file,
but regarding your questions:

address@hidden 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]