[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in ls Command
From: |
Jim Meyering |
Subject: |
Re: Bug in ls Command |
Date: |
24 May 2001 09:37:20 +0200 |
User-agent: |
Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.0.104 |
Thanks.
`ls -d' is equivalent to `ls -d .',
and since `-d' tells ls to give information (in this case just the name)
about only the specified files/directories, all you see is the name `.'.
The --help output is intended solely as a quick reference guide, with very
brief descriptions of all options. In this case, the real manual
(seen via `info ls') doesn't mention this, so I've changed it a little
to make this aspect clearer.
Index: doc/omni-utils.texi
===================================================================
RCS file: /fetish/fileutils/doc/omni-utils.texi,v
retrieving revision 1.15
diff -u -p -r1.15 omni-utils.texi
--- doc/omni-utils.texi 2001/05/21 07:05:37 1.15
+++ doc/omni-utils.texi 2001/05/24 07:27:10
@@ -4537,8 +4537,8 @@ For non-option command-line arguments th
@code{ls} lists the contents of directories, not recursively, and
omitting files with names beginning with @samp{.}. For other non-option
arguments, by default @code{ls} lists just the file name. If no
-non-option arguments are specified, @code{ls} lists the contents of the
-current directory.
+non-option argument is specified, @code{ls} operates on the current
+directory, acting as if it had been invoked with a single argument of @samp{.}.
By default, the output is sorted alphabetically. If standard output is
a terminal, the output is in columns (sorted vertically) and control
---------------------------
If you want to list only the names of directories, then you probably want
to use a different tool. Like find.
This assumes you have GNU find and shows only the names of directories
at a maximum `depth' of 1 (i.e., in the current directory):
find . -type d -maxdepth 1
Jim
Sunil Khandelwal <address@hidden> wrote:
| look at the help for -d switch it says "list directory entries instead of
| content"
| What one make out of this statement.
| I recently shifted from windows to Linux and this was my first exposure to
| UNIX words so I can't say if this is how it behave on other version.
| But I fail to understand why some one will use this switch if it just displays
| one dot. What is the use. I want to list all the directories, can you suggest
| what should I do.