From unknown Mon Aug 18 15:38:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14189: ls -d bug ?? Resent-From: "ray@electronicstheory.com" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 11 Apr 2013 20:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14189 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 14189@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Reply-To: "ray@electronicstheory.com" Received: via spool by submit@debbugs.gnu.org id=B.136571161623945 (code B ref -1); Thu, 11 Apr 2013 20:21:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 Apr 2013 20:20:16 +0000 Received: from localhost ([127.0.0.1]:46162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQNyh-0006EA-UN for submit@debbugs.gnu.org; Thu, 11 Apr 2013 16:20:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36626) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQM7c-0005MA-JD for submit@debbugs.gnu.org; Thu, 11 Apr 2013 14:21:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQM3q-0007Gt-4m for submit@debbugs.gnu.org; Thu, 11 Apr 2013 14:17:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:46697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQM3q-0007Gp-12 for submit@debbugs.gnu.org; Thu, 11 Apr 2013 14:17:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQM3l-0000Rs-MA for bug-coreutils@gnu.org; Thu, 11 Apr 2013 14:17:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQM3h-0007Ec-99 for bug-coreutils@gnu.org; Thu, 11 Apr 2013 14:17:21 -0400 Received: from atl4mhob05.myregisteredsite.com ([209.17.115.43]:60662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQM3h-0007Ag-2X for bug-coreutils@gnu.org; Thu, 11 Apr 2013 14:17:17 -0400 Received: from atl4oxapp110.mgt.hosting.qts.netsol.com ([10.30.71.147]) by atl4mhob05.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id r3BIH5nd008078 for ; Thu, 11 Apr 2013 14:17:05 -0400 Date: Thu, 11 Apr 2013 13:17:05 -0500 (CDT) From: "ray@electronicstheory.com" Message-ID: <1501207863.142881.1365704225989.JavaMail.vpopmail@mail.electronicstheory.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_142880_445338184.1365704225976" X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v6.20.5-Rev1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Mailman-Approved-At: Thu, 11 Apr 2013 16:20:14 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) ------=_Part_142880_445338184.1365704225976 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit To: The most gracious and brilliant authors of the ever useful ls command. (The title is quite heartfelt - no sarcasm intended). I have to wonder. I've been using *nix of various kinds for nigh unto 15 years. I ran into an issue today that I've seen many times, and it still irks me. I've simply never taken the time to write to anyone about it. I assumed someone would report it and it would be magically fixed in the next version, but it never seems to. I've also seen several people elude to the same problem in forums, etc. 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. Since you can use the ls command to view the files and directories that are contained in your pwd, one would THINK the intuitive method would be to type ls -d. 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 you don't get the expected result, but rather you get: . Which is like ls is telling you, "Yup, you are in a directory!" Wull DUH, like I couldn't figure out that I was in a directory. If I wanted to get more info on that I'd type pwd ! tree -dx ALMOST gives you the desired outcome, except it includes all the subdirectories of the subdirectories. ls -d, I would think, would tell you the same data that ls would tell you, minus the individual files. (In other words - show all the data with a "d" in the permissions, but not show the ones that don't have a "d" in the permissions). I'm not afraid to admit I may be missing the whole point (pardon the pun). Is it me, or am I just not understanding the importance of the " . ", and how that . might change from one directory to another? WHY does ls -d just give me a dot? Is that dot supremely important? Is there some reason it can't give me what (it appears) the manual says (and what makes sense) it should? Ray Dall Radio Frequency Engineer Author: Electronics for Sound Engineers This email sent via a virus free Linux computer. ------=_Part_142880_445338184.1365704225976 MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

To: The most gracious and brilliant authors of the ever useful ls command.

(The title is quite heartfelt - no sarcasm intended). 

 

I have to wonder.  I've been using *nix of various kinds for nigh unto 15 years.  I ran into an issue today that I've seen many times, and it still irks me.  I've simply never taken the time to write to anyone about it.  I assumed someone would report it and it would be magically fixed in the next version, but it never seems to.

I've also seen several people elude to the same problem in forums, etc.

 

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. 

 

Since you can use the ls command to view the files and directories that are contained in your pwd, one would THINK the intuitive method would be to type ls -d.

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 

 

you don't get the expected result, but rather you get: 

 

 

Which is like ls is telling you, "Yup, you are in a directory!" 

 

Wull DUH, like I couldn't figure out that I was in a directory.  If I wanted to get more info on that I'd type pwd !

tree -dx ALMOST gives you the desired outcome, except it includes all the subdirectories of the subdirectories.

ls -d, I would think, would tell you the same data that ls would tell you, minus the individual files. 

(In  other words - show all the data with a "d" in the permissions, but not show the ones that don't have a "d" in the permissions). 

 

I'm not afraid to admit I may be missing the whole point (pardon the pun).  Is it me, or am I just not understanding the importance of the " . ", and how that . might change from one directory to another? 

 

WHY does ls -d just give me a dot?  Is  that dot supremely important?  Is there some reason it can't give me what (it appears) the manual says (and what makes sense) it should? 

 

Ray Dall
Radio Frequency Engineer
Author: Electronics for Sound Engineers

This email sent via a virus free Linux computer.

------=_Part_142880_445338184.1365704225976-- From unknown Mon Aug 18 15:38:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14189: ls -d bug ?? Resent-From: Assaf Gordon Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 11 Apr 2013 21:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14189 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: "ray@electronicstheory.com" Cc: 14189@debbugs.gnu.org Received: via spool by 14189-submit@debbugs.gnu.org id=B14189.13657140125882 (code B ref 14189); Thu, 11 Apr 2013 21:01:01 +0000 Received: (at 14189) by debbugs.gnu.org; 11 Apr 2013 21:00:12 +0000 Received: from localhost ([127.0.0.1]:46237 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQObM-0001Wi-69 for submit@debbugs.gnu.org; Thu, 11 Apr 2013 17:00:12 -0400 Received: from mail-ve0-f170.google.com ([209.85.128.170]:59765) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQObK-0001WT-BL for 14189@debbugs.gnu.org; Thu, 11 Apr 2013 17:00:11 -0400 Received: by mail-ve0-f170.google.com with SMTP id 15so1879159vea.29 for <14189@debbugs.gnu.org>; Thu, 11 Apr 2013 13:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=h+dhTbulFlbz0xcqjCUpDbtDDYhGuABLptTIMYUeXUA=; b=RPjp3NSZw/aWvgRy4bpU4/BXzJ59gvLJZIDqOIS1MY8t7GT1IzewicXvhRskexi147 g/ZwoQzmecqy57O4Q41Gblzxb+gGIgHjsabVnVKO70n7xqQOkPy0IP3nCL4+8Az9JoXJ UiB0cSkUXhvhSU0PMAn/9Udbvs0cTuLv+E4pi9xs1JKayydOPnJr4zjZddAH8fmkoPNY cuEbOaMlR3KXZOl4dQ3sVSlH902+5qx0JtYGVdMAp2q6QWy4T8uhJHImJ+in2Yw6xS14 SgVJx59yKY0+Rzwl8WNR1/zh78CiBJ9VM8lPXRMfDGkAEyhJNkybmL6n4liCkkuevGkp tmMA== X-Received: by 10.221.9.136 with SMTP id ow8mr6284116vcb.58.1365713779095; Thu, 11 Apr 2013 13:56:19 -0700 (PDT) Received: from [143.48.11.9] (tango.cshl.edu. [143.48.11.9]) by mx.google.com with ESMTPS id b9sm5742400vee.3.2013.04.11.13.56.17 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Apr 2013 13:56:18 -0700 (PDT) Message-ID: <51672370.2080203@gmail.com> Date: Thu, 11 Apr 2013 16:56:16 -0400 From: Assaf Gordon User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120510 Icedove/10.0.4 MIME-Version: 1.0 References: <1501207863.142881.1365704225989.JavaMail.vpopmail@mail.electronicstheory.com> In-Reply-To: <1501207863.142881.1365704225989.JavaMail.vpopmail@mail.electronicstheory.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hello Ray, Others can provide more detailed information about the rational of the "dot" file, but regarding your questions: ray@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 From unknown Mon Aug 18 15:38:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14189: ls -d bug ?? Resent-From: Bob Proulx Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 11 Apr 2013 21:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14189 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: "ray@electronicstheory.com" Cc: 14189@debbugs.gnu.org Received: via spool by 14189-submit@debbugs.gnu.org id=B14189.136571503911399 (code B ref 14189); Thu, 11 Apr 2013 21:18:01 +0000 Received: (at 14189) by debbugs.gnu.org; 11 Apr 2013 21:17:19 +0000 Received: from localhost ([127.0.0.1]:46258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQOru-0002xj-3A for submit@debbugs.gnu.org; Thu, 11 Apr 2013 17:17:18 -0400 Received: from joseki.proulx.com ([216.17.153.58]:59496) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQOrq-0002xP-0X for 14189@debbugs.gnu.org; Thu, 11 Apr 2013 17:17:16 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 81BF6211D5; Thu, 11 Apr 2013 15:13:19 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 555CE2DC8E; Thu, 11 Apr 2013 15:13:19 -0600 (MDT) Date: Thu, 11 Apr 2013 15:13:19 -0600 From: Bob Proulx Message-ID: <20130411211319.GB18156@hysteria.proulx.com> References: <1501207863.142881.1365704225989.JavaMail.vpopmail@mail.electronicstheory.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1501207863.142881.1365704225989.JavaMail.vpopmail@mail.electronicstheory.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.3 (----) tags 14189 + notabug close 14189 thanks http://www.gnu.org/software/coreutils/faq/#ls-_002dd-does-not-list-directories_0021 ray@electronicstheory.com wrote: > 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. Thank you for your report. However what you are reporting is due to a misunderstanding of the usage of the command. > Since you can use the ls command to view the files and directories that are > contained in your pwd, one would THINK the intuitive method would be to type ls > -d. But that is not correct. And it isn't as documented. > Interestingly, the MAN page seems to indicate that this is the way to go, You have fallen into a trap. The computer is executing a program and does *exactly* what it was programmed to do. The documentation is written to say exactly what the program does. But you are thinking like a human and making an interpretation and an extrapolation based upon what you *want* it to do. Those are different things. The GNU ls documentation says this: `-d' `--directory' List just the names of directories, as with other types of files, rather than listing their contents. Do not follow symbolic links listed on the command line unless the `--dereference-command-line' (`-H'), `--dereference' (`-L'), or `--dereference-command-line-symlink-to-dir' options are specified. The GNU ls man page says: -d, --directory list directory entries instead of contents, and do not dereference symbolic links The online standards documents say: http://pubs.opengroup.org/onlinepubs/009695399/utilities/ls.html -d Do not follow symbolic links named as operands unless the -H or -L options are specified. Do not treat directories differently than other types of files. The use of -d with -R produces unspecified results. Each and every one of those applies the -d option to the arguments of the ls command. But what are the arguments to ls? If you type in ls with an argument then there is no doubt. $ mkdir foodir $ touch foodir/foofile1 $ ls foodir foofile1 At that point there is no doubt. You are asking it to list foodir. Let's apply the -d option. $ ls -d foodir foodir The -d option clearly applies to foodir. Therefore it prevents it from listing the contents. It lists only the name of the directory. This is as documented for -d that it lists only names and using -d prevents it from listing the directory argument contents. But what happens if you don't give ls an option? What is the default argument to ls? The GNU ls documentation says: 10.1 `ls': List directory contents ================================== The `ls' program lists information about files (of any type, including directories). Options and file arguments can be intermixed arbitrarily, as usual. For non-option command-line arguments that are directories, by default `ls' lists the contents of directories, not recursively, and omitting files with names beginning with `.'. For other non-option arguments, by default `ls' lists just the file name. If no non-option argument is specified, `ls' operates on the current directory, acting as if it had been invoked with a single argument of `.'. That last line says it. Let me repeat it for emphasis. If no non-option argument is specified, `ls' operates on the current directory, acting as if it had been invoked with a single argument of `.'. If no arguments are specified then ls lists '.' as if it had been invoked "ls .". > however, regardless of what directory you are in, if you type > > ls -d If you run "ls -d" then we know from the documentation that it is the same as saying "ls -d ." and that will simply list the name of it because the -d option says only list the names of directories. Therefore the expected behavior is that it must only list the name of the '.' directory. > you don't get the expected result, but rather you get: > . Unfortunately you had incorrect expectations! :-) Any other result would be a bug. I hope I have convinced you that that ls is doing the right thing here and behaving as documented even if it isn't doing what you want it to do. This is a common misunderstanding and is one of the FAQ entries. Please read the FAQ entry here: 17 ls -d does not list directories! http://www.gnu.org/software/coreutils/faq/#ls-_002dd-does-not-list-directories_0021 > Wull DUH, like I couldn't figure out that I was in a directory. If I wanted to > get more info on that I'd type pwd ! If you didn't want it to list only the name of the directory and not the contents then why did you use the -d option? Since -d specifically prevents it from listing the contents. > ls -d, I would think, would tell you the same data that ls would tell you, minus > the individual files. > (In other words - show all the data with a "d" in the permissions, but not show > the ones that don't have a "d" in the permissions). Perhaps you want this? $ ls -log | grep ^d $ ls -log | grep -v ^d Or one of these: $ find . -maxdepth 1 -type d -ls $ find . -maxdepth 1 -type d -exec ls -logd {} + I definitely recommend reading about "find". It is an extremely useful command. Knowledge of it will apply to all of the utilities uniformly. I have gone ahead and closed this since it isn't a bug. But please feel free to continue the discussion. It will all go into the bug log and perhaps help the next person who searches for the information. Bob From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 11 17:19:03 2013 Received: (at control) by debbugs.gnu.org; 11 Apr 2013 21:19:03 +0000 Received: from localhost ([127.0.0.1]:46263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQOtb-00034S-5F for submit@debbugs.gnu.org; Thu, 11 Apr 2013 17:19:03 -0400 Received: from joseki.proulx.com ([216.17.153.58]:59503) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQOtY-00033u-9P for control@debbugs.gnu.org; Thu, 11 Apr 2013 17:19:01 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id E7F5A211D5 for ; Thu, 11 Apr 2013 15:15:07 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id CCF962DC8E; Thu, 11 Apr 2013 15:15:07 -0600 (MDT) Date: Thu, 11 Apr 2013 15:15:07 -0600 From: Bob Proulx To: control@debbugs.gnu.org Subject: tag and close Message-ID: <20130411211507.GA30509@hysteria.proulx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) tag 14189 + notabug close 14189 thanks Already sent information to the mailing list and submitter. From unknown Mon Aug 18 15:38:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14189: ls -d bug ?? Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 11 Apr 2013 21:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14189 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: "ray@electronicstheory.com" Cc: 14189@debbugs.gnu.org Received: via spool by 14189-submit@debbugs.gnu.org id=B14189.136571544113202 (code B ref 14189); Thu, 11 Apr 2013 21:24:02 +0000 Received: (at 14189) by debbugs.gnu.org; 11 Apr 2013 21:24:01 +0000 Received: from localhost ([127.0.0.1]:46289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQOyO-0003Qj-2I for submit@debbugs.gnu.org; Thu, 11 Apr 2013 17:24:01 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:52774) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQOyK-0003QH-BH for 14189@debbugs.gnu.org; Thu, 11 Apr 2013 17:23:58 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 3A587A60005; Thu, 11 Apr 2013 14:20:04 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id McsTLQRFQzeK; Thu, 11 Apr 2013 14:20:03 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id D964EA60002; Thu, 11 Apr 2013 14:20:03 -0700 (PDT) Message-ID: <51672903.5070009@cs.ucla.edu> Date: Thu, 11 Apr 2013 14:20:03 -0700 From: Paul Eggert User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 References: <1501207863.142881.1365704225989.JavaMail.vpopmail@mail.electronicstheory.com> In-Reply-To: <1501207863.142881.1365704225989.JavaMail.vpopmail@mail.electronicstheory.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.9 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.7 (----) On 04/11/13 11:17, ray@electronicstheory.com wrote: > Is there > some reason it can't give me what (it appears) the manual says (and what makes > sense) it should? Sounds like there's a bug in the manual; it shouldn't say that "ls -d" outputs only directories. Can you please mention the wording you're talking about? To get something like what you want, you can use this command: ls -d */ or maybe: ls -d */ .*/ From unknown Mon Aug 18 15:38:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14189: ls -d bug ?? Resent-From: Eric Blake Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 11 Apr 2013 21:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14189 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: Bob Proulx Cc: "ray@electronicstheory.com" , 14189@debbugs.gnu.org Received: via spool by 14189-submit@debbugs.gnu.org id=B14189.136571611119850 (code B ref 14189); Thu, 11 Apr 2013 21:36:01 +0000 Received: (at 14189) by debbugs.gnu.org; 11 Apr 2013 21:35:11 +0000 Received: from localhost ([127.0.0.1]:46304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQP9D-0005A6-GS for submit@debbugs.gnu.org; Thu, 11 Apr 2013 17:35:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12584) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQP9A-00059q-MA for 14189@debbugs.gnu.org; Thu, 11 Apr 2013 17:35:11 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3BLVGb3026153 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Apr 2013 17:31:16 -0400 Received: from [10.3.113.14] ([10.3.113.14]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3BLVF4o023178; Thu, 11 Apr 2013 17:31:15 -0400 Message-ID: <51672BA3.8040309@redhat.com> Date: Thu, 11 Apr 2013 15:31:15 -0600 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5 MIME-Version: 1.0 References: <1501207863.142881.1365704225989.JavaMail.vpopmail@mail.electronicstheory.com> <20130411211319.GB18156@hysteria.proulx.com> In-Reply-To: <20130411211319.GB18156@hysteria.proulx.com> X-Enigmail-Version: 1.5.1 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2RFJAUFTMDRDRKNGBSXAN" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -7.4 (-------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -9.3 (---------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2RFJAUFTMDRDRKNGBSXAN Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/11/2013 03:13 PM, Bob Proulx wrote: >=20 > If you didn't want it to list only the name of the directory and not > the contents then why did you use the -d option? Since -d > specifically prevents it from listing the contents. >=20 >> ls -d, I would think, would tell you the same data that ls would tell = you, minus >> the individual files. >> (In other words - show all the data with a "d" in the permissions, bu= t not show >> the ones that don't have a "d" in the permissions). >=20 > Perhaps you want this? >=20 > $ ls -log | grep ^d > $ ls -log | grep -v ^d >=20 > Or one of these: >=20 > $ find . -maxdepth 1 -type d -ls > $ find . -maxdepth 1 -type d -exec ls -logd {} + Or you could use this to approximate things: $ ls -d */ the trailing slash forces the shell to filter out non-directories as part of expanding the glob, and then list just the names instead of the contents of all remaining directories. But as written that only lists non-hidden directories. If you don't mind listing '.', you can get closer with: $ ls -d */ .*/ But for a full list of all subdirectory names excluding '.' and '..', you need three globs; and either a shell option that suppresses a glob that has no match, or ignoring the errors when ls tries to warn you when a glob doesn't match: Portable (but risks hiding errors): $ ls -d */ .[!.]/ .??*/ 2>/dev/null bash-specific: $ (shopt -s nullglob; ls -d */ .[!.]/ .??*/) All the sudden, the 'find' alternative suddenly seems nicer :) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2RFJAUFTMDRDRKNGBSXAN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRZyujAAoJEKeha0olJ0NqZ2MIAIOIoRC5eRuk5C8oS+93vV3J p8i7cagezs3ohlwpaSORHGylFj38pUFMFg7hfvuS9347Q1y8CFCsJbL0HZs1xvoD JP0vcofRziS9PgMg1uOZsUdgZmPIXLNdTLONEJqOA7vbRkmEwpLS56fW6IazhMxY uOaM648JGSSA5ZbG+bKLUCHmBFLPI15o8G9L8MCADtaVesXe2zgDQFXjq2L2v7Na gYEEBk/DqqbzDiF/jsBqK89OyFtXErciFETX1jKHgIMZpfStfpIBtbLernfWCQWS gfs9S+kfuwP6hbG1L5covQD9LnBJ8+53KQiuxKNIaZpdW5C0mFcuqSZxcB985zY= =bwjk -----END PGP SIGNATURE----- ------enig2RFJAUFTMDRDRKNGBSXAN-- From unknown Mon Aug 18 15:38:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14189: ls -d bug ?? Resent-From: Eric Blake Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 11 Apr 2013 21:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14189 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug Cc: "ray@electronicstheory.com" , 14189@debbugs.gnu.org, Bob Proulx Received: via spool by 14189-submit@debbugs.gnu.org id=B14189.136571672823137 (code B ref 14189); Thu, 11 Apr 2013 21:46:02 +0000 Received: (at 14189) by debbugs.gnu.org; 11 Apr 2013 21:45:28 +0000 Received: from localhost ([127.0.0.1]:46337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQPJA-000613-AH for submit@debbugs.gnu.org; Thu, 11 Apr 2013 17:45:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18526) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQPJ6-00060a-T0 for 14189@debbugs.gnu.org; Thu, 11 Apr 2013 17:45:26 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3BLfWsv011139 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Apr 2013 17:41:32 -0400 Received: from [10.3.113.14] ([10.3.113.14]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3BLfVsu026229; Thu, 11 Apr 2013 17:41:31 -0400 Message-ID: <51672E0B.50602@redhat.com> Date: Thu, 11 Apr 2013 15:41:31 -0600 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5 MIME-Version: 1.0 References: <1501207863.142881.1365704225989.JavaMail.vpopmail@mail.electronicstheory.com> <20130411211319.GB18156@hysteria.proulx.com> <51672BA3.8040309@redhat.com> In-Reply-To: <51672BA3.8040309@redhat.com> X-Enigmail-Version: 1.5.1 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2CEOKBQWGQHTTDCKNECUW" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -8.3 (--------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2CEOKBQWGQHTTDCKNECUW Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/11/2013 03:31 PM, Eric Blake wrote: > But for a full list of all subdirectory names excluding '.' and '..', > you need three globs; and either a shell option that suppresses a glob > that has no match, or ignoring the errors when ls tries to warn you whe= n > a glob doesn't match: >=20 > Portable (but risks hiding errors): > $ ls -d */ .[!.]/ .??*/ 2>/dev/null Be aware that this also runs the risk of generating too long of a command line if the globs expand to a lot of names; while find specifically avoids exceeding command line length limits. On the other hand, while ls defaults to sorting its output, find does not; so if you need sorted output, you have to start considering the use of non-POSIX extensions such as GNU find's -print0 and sort's -z to generate and sort the list with unambiguous terminators, if you are worried that any of the names found might contain a newline in the name. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2CEOKBQWGQHTTDCKNECUW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRZy4LAAoJEKeha0olJ0NqNMIH/0Zx8afePMjNMRgqRp4/+886 86Z620FgG8RTB27p6MDMP++gZsMyTjirc3UGy8nVgOuvM7knDJ0W9HUUWSIOv+P8 ahicNJaY9JWD/wyClXa9ILD9d9XUDxwajs/0laTqcWh8pqN9xDsP4oSF/U49gguy sW1ByfSkDjaZ3GUlWuPfjhTUm1m8PfAcPe7oFx2CK4z6ohn1bOHtNo1RN0DyYjUY zx03Peg78v2WACJ1jXrTbzup0uS7k81JFtLnsBkIt15Muk09dZ0JA8AzJ511X+Xj LeOiZEyty7PK43WbyxhzhM48TBI9uSFdbEOcdxNvAWSP8I2GXK26w51Ma5dOd6E= =iP+e -----END PGP SIGNATURE----- ------enig2CEOKBQWGQHTTDCKNECUW-- From unknown Mon Aug 18 15:38:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14189: ls -d bug ?? Resent-From: Bob Proulx Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 12 Apr 2013 05:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14189 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: 14189@debbugs.gnu.org Cc: "ray@electronicstheory.com" Received: via spool by 14189-submit@debbugs.gnu.org id=B14189.136574559617741 (code B ref 14189); Fri, 12 Apr 2013 05:47:01 +0000 Received: (at 14189) by debbugs.gnu.org; 12 Apr 2013 05:46:36 +0000 Received: from localhost ([127.0.0.1]:46788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQWol-0004c4-Ko for submit@debbugs.gnu.org; Fri, 12 Apr 2013 01:46:35 -0400 Received: from joseki.proulx.com ([216.17.153.58]:33142) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQWoi-0004bb-6n for 14189@debbugs.gnu.org; Fri, 12 Apr 2013 01:46:33 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 3DC9F211D5; Thu, 11 Apr 2013 23:42:38 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 0E5C62DC8E; Thu, 11 Apr 2013 23:42:37 -0600 (MDT) Date: Thu, 11 Apr 2013 23:42:37 -0600 From: Bob Proulx Message-ID: <20130412054237.GA32546@hysteria.proulx.com> References: <1501207863.142881.1365704225989.JavaMail.vpopmail@mail.electronicstheory.com> <20130411211319.GB18156@hysteria.proulx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130411211319.GB18156@hysteria.proulx.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.3 (----) Bob Proulx wrote: > 10.1 `ls': List directory contents > ================================== > > The `ls' program lists information about files (of any type, including > directories). Options and file arguments can be intermixed > arbitrarily, as usual. > > For non-option command-line arguments that are directories, by > default `ls' lists the contents of directories, not recursively, and > omitting files with names beginning with `.'. For other non-option > arguments, by default `ls' lists just the file name. If no non-option > argument is specified, `ls' operates on the current directory, acting > as if it had been invoked with a single argument of `.'. That does seem like it could use some improvement. It makes the mistake of "burying the lead" by putting that last sentence so far down. I like the BSD man page version much better. Is there a way we can simplify this but still keep it descriptive? The FreeBSD man page is much better for this description. How about this? (I will work it up into a texinfo patch afterward.) The `ls' program lists information about files. If the file being listed is a directory then the contents of the directory is listed. If no non-option command-line arguments are specified then 'ls' operates on the current directory, acting as if it had been invoked with a single argument of `.'. `ls' is the same as `ls .'. For each non-option command-line argument that is not a directory `ls' lists the file name. For each non-option command-line argument that is a directory `ls' lists the names of files in the directory. Files starting with a '.' are ignored and hidden. WDYT? > `-d' > `--directory' > List just the names of directories, as with other types of files, > rather than listing their contents. Do not follow symbolic links > listed on the command line unless the `--dereference-command-line' > (`-H'), `--dereference' (`-L'), or > `--dereference-command-line-symlink-to-dir' options are specified. And then perhaps this following. Also the above does not describe the interaction with -R. Option 1: `-d' `--directory' Do not list the contents of directories. List only the name. Do not follow symbolic links unless the `--dereference-command-line' (`-H'), `--dereference' (`-L'), or `--dereference-command-line-symlink-to-dir' options are specified. Overrides `--recursive', (`-R'). Option 2 with much more description: `-d' `--directory' Do not list the contents of directories. List only the name. Without this option any non-option command-line arguments that are directories are treated specially and instead of the name the contents are listed. This option turns that behavior off and directories are only listed by name, the same as any non-directory file. This is most typically used with `-l' to list the information for the directory itself instead of its contents. Do not follow symbolic links unless the `--dereference-command-line' (`-H'), `--dereference' (`-L'), or `--dereference-command-line-symlink-to-dir' options are specified. Overrides `--recursive', (`-R'). I like the conciseness of the first. But the extra description in the second seems useful. WDYT? Bob From unknown Mon Aug 18 15:38:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14189: ls -d bug ?? Resent-From: Bob Proulx Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 12 Apr 2013 06:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14189 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: 14189@debbugs.gnu.org Cc: "ray@electronicstheory.com" Received: via spool by 14189-submit@debbugs.gnu.org id=B14189.136574701525318 (code B ref 14189); Fri, 12 Apr 2013 06:11:02 +0000 Received: (at 14189) by debbugs.gnu.org; 12 Apr 2013 06:10:15 +0000 Received: from localhost ([127.0.0.1]:46795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQXBe-0006aI-Ny for submit@debbugs.gnu.org; Fri, 12 Apr 2013 02:10:15 -0400 Received: from joseki.proulx.com ([216.17.153.58]:33234) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQXBa-0006a1-4K for 14189@debbugs.gnu.org; Fri, 12 Apr 2013 02:10:13 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 4F3D4211D5; Fri, 12 Apr 2013 00:06:16 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 32FBE2DC8E; Fri, 12 Apr 2013 00:06:16 -0600 (MDT) Date: Fri, 12 Apr 2013 00:06:16 -0600 From: Bob Proulx Message-ID: <20130412060615.GA12225@hysteria.proulx.com> References: <1501207863.142881.1365704225989.JavaMail.vpopmail@mail.electronicstheory.com> <20130411211319.GB18156@hysteria.proulx.com> <20130412054237.GA32546@hysteria.proulx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130412054237.GA32546@hysteria.proulx.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) Bob Proulx wrote: > Option 2 with much more description: > > `-d' > `--directory' > Do not list the contents of directories. List only the name. > Without this option any non-option command-line arguments that > are directories are treated specially and instead of the name the > contents are listed. This option turns that behavior off and > directories are only listed by name, the same as any > non-directory file. This is most typically used with `-l' to > list the information for the directory itself instead of its > contents. Do not follow symbolic links unless the > `--dereference-command-line' (`-H'), `--dereference' (`-L'), or > `--dereference-command-line-symlink-to-dir' options are > specified. Overrides `--recursive', (`-R'). Some local wordsmithing turned out the following as a better improvement. It lists what it does in the positive first. And removes the negative which was seen as being too confusing. `-d' `--directory' List only the name of directories, not the contents. This is most typically used with `-l' to list the information for the directory itself instead of its contents. Do not follow symbolic links unless the `--dereference-command-line' (`-H'), `--dereference' (`-L'), or `--dereference-command-line-symlink-to-dir' options are specified. Overrides `--recursive', (`-R'). Bob From unknown Mon Aug 18 15:38:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14189: ls -d bug ?? Resent-From: Bernhard Voelker Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 12 Apr 2013 07:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14189 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: Bob Proulx Cc: 14189@debbugs.gnu.org, "ray@electronicstheory.com" Received: via spool by 14189-submit@debbugs.gnu.org id=B14189.136575248827224 (code B ref 14189); Fri, 12 Apr 2013 07:42:01 +0000 Received: (at 14189) by debbugs.gnu.org; 12 Apr 2013 07:41:28 +0000 Received: from localhost ([127.0.0.1]:46847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQYbr-00074Q-KC for submit@debbugs.gnu.org; Fri, 12 Apr 2013 03:41:28 -0400 Received: from moutng.kundenserver.de ([212.227.126.187]:51566) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQYbl-00073Q-37 for 14189@debbugs.gnu.org; Fri, 12 Apr 2013 03:41:21 -0400 Received: from [192.168.1.11] (p4FC3E1E8.dip.t-dialin.net [79.195.225.232]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0M7DTa-1UkpDs2PMk-00x3QI; Fri, 12 Apr 2013 09:37:18 +0200 Message-ID: <5167B9AC.4040201@bernhard-voelker.de> Date: Fri, 12 Apr 2013 09:37:16 +0200 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 References: <1501207863.142881.1365704225989.JavaMail.vpopmail@mail.electronicstheory.com> <20130411211319.GB18156@hysteria.proulx.com> <20130412054237.GA32546@hysteria.proulx.com> <20130412060615.GA12225@hysteria.proulx.com> In-Reply-To: <20130412060615.GA12225@hysteria.proulx.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:85PeYLRfQJNJ2ULnwTr7/TNdNGp1yFuAm4AIiZwUD5a oVAeByG+9tcooZCX5HmhrsspzwHUT+Z+GOIW4bf/QAEQqSPQxR uN2IYuu45zuLC14SHRpgmRSV/+zCBcjWbsZm6qRBAp8xT6gVF4 vX+UjAfn2ggZA/yO85wO+8dwwJy3g84mmV/0d81tM9I/GAIAJJ zPhQyXPafruGZBs4cnXTlk6dbHa7GdiGePX1PgSVjJ5rN0BD0G RntWR5wx7OdMGFiXufEl9l7UimHQaYKrbV9WOI4NjVShYaf4DC wM2DPNcVI6TQQ+l7SLJn7IYqng7jhWBTONfKayy9LuKC3CgAuv SaLPu7qPfZmBEMQuSL3QQAZvk9an8iTuNJQcDSwgF X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On 04/12/2013 08:06 AM, Bob Proulx wrote: > Some local wordsmithing turned out the following as a better > improvement. It lists what it does in the positive first. And > removes the negative which was seen as being too confusing. > > `-d' > `--directory' > List only the name of directories, not the contents. This is > most typically used with `-l' to list the information for the > directory itself instead of its contents. Do not follow symbolic > links unless the `--dereference-command-line' (`-H'), > `--dereference' (`-L'), or > `--dereference-command-line-symlink-to-dir' options are > specified. Overrides `--recursive', (`-R'). Not bad, but I'm still missing the point that `-d' changes ls's behavior for *directory arguments* only. Furthermore, I don't think mentioning `-l' is of much relevance here. So this would melt down the first two sentences as follows: `-d' `--directory' For directory arguments, list only the information for the directory itself instead of its contents. Do not follow symbolic links unless the `--dereference-command-line' (`-H'), `--dereference' (`-L'), or `--dereference-command-line-symlink-to-dir' options are specified. Overrides `--recursive', (`-R'). And what about the usage() string? I'd bet this is still 95% where users are looking for. Something like the following perhaps? - -d, --directory list directory entries instead of contents, - and do not dereference symbolic links + -d, --directory for directory arguments, list the entry itself + instead of contents, and do not dereference + symbolic links Have a nice day, Berny From unknown Mon Aug 18 15:38:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14189: ls -d bug ?? Resent-From: Andreas Schwab Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 12 Apr 2013 09:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14189 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: Eric Blake Cc: "ray@electronicstheory.com" , 14189@debbugs.gnu.org, Bob Proulx Received: via spool by 14189-submit@debbugs.gnu.org id=B14189.136575733725631 (code B ref 14189); Fri, 12 Apr 2013 09:03:01 +0000 Received: (at 14189) by debbugs.gnu.org; 12 Apr 2013 09:02:17 +0000 Received: from localhost ([127.0.0.1]:46909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQZs8-0006fG-AE for submit@debbugs.gnu.org; Fri, 12 Apr 2013 05:02:16 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:37291) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQZs5-0006eg-J7 for 14189@debbugs.gnu.org; Fri, 12 Apr 2013 05:02:15 -0400 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3ZnCgY61tsz4KK47; Fri, 12 Apr 2013 10:58:17 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3ZnCgY3tfTzbc6K; Fri, 12 Apr 2013 10:58:17 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id EjL6AjQuU2yN; Fri, 12 Apr 2013 10:58:16 +0200 (CEST) X-Auth-Info: tRRbf0sluAAl/7YyjJrHU4JaUkQnB4MzxttAV4snf10= Received: from igel.home (ppp-93-104-148-12.dynamic.mnet-online.de [93.104.148.12]) by mail.mnet-online.de (Postfix) with ESMTPA; Fri, 12 Apr 2013 10:58:16 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 15312CA2B4; Fri, 12 Apr 2013 10:58:15 +0200 (CEST) From: Andreas Schwab References: <1501207863.142881.1365704225989.JavaMail.vpopmail@mail.electronicstheory.com> <20130411211319.GB18156@hysteria.proulx.com> <51672BA3.8040309@redhat.com> X-Yow: I'll take ROAST BEEF if you're out of LAMB!! Date: Fri, 12 Apr 2013 10:58:15 +0200 In-Reply-To: <51672BA3.8040309@redhat.com> (Eric Blake's message of "Thu, 11 Apr 2013 15:31:15 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Eric Blake writes: > bash-specific: > $ (shopt -s nullglob; ls -d */ .[!.]/ .??*/) $ (shopt -s dotglob; ls -d */) Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From unknown Mon Aug 18 15:38:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14189: ls -d bug ?? Resent-From: Bob Proulx Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 18 Apr 2013 19:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14189 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: 14189@debbugs.gnu.org Cc: "ray@electronicstheory.com" Received: via spool by 14189-submit@debbugs.gnu.org id=B14189.136631316319672 (code B ref 14189); Thu, 18 Apr 2013 19:27:01 +0000 Received: (at 14189) by debbugs.gnu.org; 18 Apr 2013 19:26:03 +0000 Received: from localhost ([127.0.0.1]:59043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1USuT5-00057D-5a for submit@debbugs.gnu.org; Thu, 18 Apr 2013 15:26:03 -0400 Received: from joseki.proulx.com ([216.17.153.58]:45964) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1USuT3-00056n-2g for 14189@debbugs.gnu.org; Thu, 18 Apr 2013 15:26:02 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 69A23211DA; Thu, 18 Apr 2013 13:21:30 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 185DC2DCE3; Thu, 18 Apr 2013 13:21:30 -0600 (MDT) Date: Thu, 18 Apr 2013 13:21:30 -0600 From: Bob Proulx Message-ID: <20130418192129.GE8048@hysteria.proulx.com> References: <1501207863.142881.1365704225989.JavaMail.vpopmail@mail.electronicstheory.com> <20130411211319.GB18156@hysteria.proulx.com> <20130412054237.GA32546@hysteria.proulx.com> <20130412060615.GA12225@hysteria.proulx.com> <5167B9AC.4040201@bernhard-voelker.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5167B9AC.4040201@bernhard-voelker.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Bernhard Voelker wrote: > Bob Proulx wrote: > > `-d' > > `--directory' > > List only the name of directories, not the contents. This is > > most typically used with `-l' to list the information for the > > directory itself instead of its contents. Do not follow symbolic > > links unless the `--dereference-command-line' (`-H'), > > `--dereference' (`-L'), or > > `--dereference-command-line-symlink-to-dir' options are > > specified. Overrides `--recursive', (`-R'). > > Not bad, but I'm still missing the point that `-d' changes ls's behavior > for *directory arguments* only. Hmm... "If an argument is a directory then list only the name of the directory not the contents. Otherwise list the name of the file normally." Showing this around I had one person who was shocked to learn that directories were files. They really wanted this written so that it acted as if directories and files were completely different things. I countered that since directores were files, special files, that we shouldn't make the documentation lead people astray just to make it fit a wrong model of the machine. > Furthermore, I don't think mentioning `-l' is of much relevance here. > So this would melt down the first two sentences as follows: > > `-d' > `--directory' > For directory arguments, list only the information for the > directory itself instead of its contents. Do not follow symbolic > links unless the `--dereference-command-line' (`-H'), > `--dereference' (`-L'), or > `--dereference-command-line-symlink-to-dir' options are > specified. Overrides `--recursive', (`-R'). > That comment made the person who I worked with wordsmithing that line very sad. She was adamant that that tidbit about -l was the only useful part of the option description. And I think I agree that for someone reading the documentation and learning about it that the connection between -d and -l is important to point out explicitly. Maybe not this way but in some way I think we need to tie those two concepts together. > And what about the usage() string? I'd bet this is still 95% where > users are looking for. Something like the following perhaps? > > - -d, --directory list directory entries instead of contents, > - and do not dereference symbolic links > + -d, --directory for directory arguments, list the entry itself > + instead of contents, and do not dereference > + symbolic links I think that is definitely an improvement. Because "entries" in the original I think isn't descriptive enough and makes people think contents instead of just the argument name. But frankly I still don't think it flows very well. If we are already pushed into three lines then let's make use of them. -d, --directory for directory arguments, list the name instead of contents, and do not dereference symbolic links Or perhaps better is: -d, --directory for directory arguments, list the directory name instead of directory contents, and do not dereference symbolic links Looking through other options for style I see: -L, --dereference when showing file information for a symbolic link, show information for the file the link references rather than for the link itself That entry has the same challenge. It is much wordier. The "when showing file information for a symbolic link" is the same task as our "when showing file information for a directory". I like the shorter version "for symbolic link arguments" form. Perhaps as a separate improvement we could change it to: -L, --dereference for symbolic link arguments, show information for the target instead of for the link itself And then perhaps while gaining consistency of description without decreasing the usefulness of either entry we would gain back the line that we used above. Bob