GNU bug report logs - #14189
ls -d bug ??

Previous Next

Package: coreutils;

Reported by: "ray <at> electronicstheory.com" <ray <at> electronicstheory.com>

Date: Thu, 11 Apr 2013 20:21:02 UTC

Severity: normal

Tags: notabug

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 14189 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: "ray <at> electronicstheory.com" <ray <at> electronicstheory.com>
Cc: 14189 <at> debbugs.gnu.org
Subject: Re: bug#14189: ls -d bug ??
Date: Thu, 11 Apr 2013 16:56:16 -0400
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 95 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.