Re: Newbie - How to get the directory listing only
Date: Sat, 24 Sep 2005 11:56:00 -0400
In article <firstname.lastname@example.org>,
"PradeepR" <email@example.com> wrote:
> I am trying to find a way to list only the directories in particular
> UNIX folder. I have tried to find the command in the Net, but without
> I have tried
> ls -d
> ls -d *
> What it does is, displays files as well as directories. The only
> difference was that, it did not display the files under that directory.
The -d option means not to descend *into* directories (i.e. list the
directory itself, not its contents), it doesn't mean to list only
ls -d */.
This will also include symbolic links that point to directories, though.
Another solution is:
find * -type d -print -prune
Barry Margolin, firstname.lastname@example.org
*** PLEASE post questions in newsgroups, not directly to me ***
- Re: Im too stupid to use find, can someone help me out, please?
... > I'd like to delete all symbolic links in a directory. ... > following arguments to find are taken to be arguments to the command ... > ' but without success. ... Love is sunshine, hate is shadow, Life is checkered shade and sunshine. ...
- Re: TRUE is 0 is FALSE
... The first evaluates to success, the second to failure ... model for arithmetic expansion and arithmetic command completely clear. ... accept the boolean semantics of the "Exit Code" implementation model. ...
- RE: How to capture SQL statement messages in DTS log file
... when server run the command 'update statistics ' ... -- Return 0 to the calling program to indicate success. ... Microsoft Online Community Support ...
- [SLE] Re: postfix bug: SuSEconfig.postfix runs arbitrary command, and/or fails but returns success c
... >> configuration and then incorrectly report that it has done so ... A system utility relying upon the command search path of its ... And the fact that it returns 0, which indicates success, after ...
- Re: [PATCH 03/11] block: add rq->resid_len
... on request failure means anything. ... A failed write command MUST NOT cause any actual ... I do have Kernel code that relays on this. ... On success, we should guarantee resid count is valid, ...