Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

WWWXXXDOCO, nu vot, WWWXXXAPC, dhcpd lease file "binding state", WWWXXXDOCO, how to setup procmail to process html2text, how to setup procmail html2text, WWWXXXAPC., XXXCNZZZ, ss4000 recovery array

Links

XODOX
Impressum

#1: List (sub) directories

Posted on 2005-02-15 20:23:28 by 50295

Is there a command like ls that lists only the sub-directores of the
current dirctory? I am not interested in files

Thanks,

- Olumide

Report this message

#2: Re: List (sub) directories

Posted on 2005-02-15 20:28:30 by dozzie

Zawarto¶æ nag³ówka ["Followup-To:" comp.unix.shell.]
On 2005-02-15, 50295@web.de wrote:
> Is there a command like ls that lists only the sub-directores of the
> current dirctory? I am not interested in files

find . -type d

--
Feel free to correct my English.
Stanislaw Klekot

Report this message

#3: Re: List (sub) directories

Posted on 2005-02-15 20:31:39 by Christian Schneider

Thus spake 50295@web.de (50295@web.de):
> Is there a command like ls that lists only the sub-directores of the
> current dirctory? I am not interested in files

Use Zsh: `ls -ld **/*(/)'

Report this message

#4: Re: List (sub) directories

Posted on 2005-02-16 03:29:10 by bonomi

In article <1108495408.063443.176890@o13g2000cwo.googlegroups.com>,
<50295@web.de> wrote:
>Is there a command like ls that lists only the sub-directores of the
>current dirctory? I am not interested in files
>

something like:
ls -ld |grep ^d
perhaps?

Report this message

#5: Re: List (sub) directories

Posted on 2005-02-16 03:49:41 by bevakupf

On 15 Feb 2005 11:23:28 -0800,
50295@web.de (50295@web.de) wrote:
> Is there a command like ls that lists only the sub-directores of the
> current dirctory? I am not interested in files
>

`find . -type d` will recursively find all the sub-directories of the
current directory.

`find . -type d -maxdepth 1` will restrict the search & results to just
the sub-directories of the current directory.

Beverly
--
Many a smale maketh a grate -- Geoffrey Chaucer

Report this message

#6: Re: List (sub) directories

Posted on 2005-02-16 05:32:13 by cfajohnson

On Tue, 15 Feb 2005 at 19:23 GMT, 50295@web.de wrote:
> Is there a command like ls that lists only the sub-directores of the
> current dirctory? I am not interested in files

In a POSIX shell (bash, ksh, ash, etc):

ls */

In a Bourne shell:

ls */.

--
Chris F.A. Johnson http://cfaj.freeshell.org/shell
============================================================ =======
My code (if any) in this post is copyright 2005, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License

Report this message

#7: Re: List (sub) directories

Posted on 2005-02-16 05:37:41 by cfajohnson

On Wed, 16 Feb 2005 at 04:32 GMT, Chris F.A. Johnson wrote:
> On Tue, 15 Feb 2005 at 19:23 GMT, 50295@web.de wrote:
>> Is there a command like ls that lists only the sub-directores of the
>> current dirctory? I am not interested in files
>
> In a POSIX shell (bash, ksh, ash, etc):
>
> ls */
>
> In a Bourne shell:
>
> ls */.

You will probably want to use the -d option with those:

ls -d */
ld -d */.


--
Chris F.A. Johnson http://cfaj.freeshell.org/shell
============================================================ =======
My code (if any) in this post is copyright 2005, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License

Report this message

#8: Re: List (sub) directories

Posted on 2005-02-16 05:39:49 by mwang

In article <1108495408.063443.176890@o13g2000cwo.googlegroups.com>,
<50295@web.de> wrote:
>Is there a command like ls that lists only the sub-directores of the
>current dirctory? I am not interested in files

for i in *; do
[[ -d $i ]] && print -- "$i"
done
--
For low fair air travel, take Independence Air - http://www.flyi.com/.
Michael Wang * http://www.unixlabplus.com/ * mwang@unixlabplus.com

Report this message