bug-coreutils
[Top][All Lists]
Advanced

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

Re: why "ls -d" does not work?


From: Philip Rowlands
Subject: Re: why "ls -d" does not work?
Date: Tue, 14 Sep 2004 09:42:50 +0100 (BST)

On Tue, 14 Sep 2004, Joe wrote:

>I type "ls --help"
>it shows " -d, --directory  list directory entries instead of contents,
>and do not dereference symbolic links"
>
>then I type "ls -d" under my home directory, it display nothing , but
>actually there are some directories under my home directory.

By default, ls will list the files inside a given directory, e.g.

$ ls -l /tmp
-rw-r--r--    1 prowlands users         406 Sep  7 14:58 114784.txt
-rw-r--r--    1 prowlands users           0 Sep  6 10:59 Acro5QRJo3
-rw-r--r--    1 prowlands users       11424 Sep  6 11:05 Acro5S37FS

If, instead, you wanted to list the directory itself, that's what -d is
for:

$ ls -l -d /tmp
drwxrwxrwt   13 root     root         4096 Sep 14 04:02 /tmp


The "-d" option doesn't mean "list only directories" in the way you
suggest.


Cheers,
Phil




reply via email to

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