List (sub) directories

List (sub) directories

am 15.02.2005 20:23:28 von 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

Re: List (sub) directories

am 15.02.2005 20:28:30 von 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

Re: List (sub) directories

am 15.02.2005 20:31:39 von 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 **/*(/)'

Re: List (sub) directories

am 16.02.2005 03:29:10 von 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?

Re: List (sub) directories

am 16.02.2005 03:49:41 von 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

Re: List (sub) directories

am 16.02.2005 05:32:13 von 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

Re: List (sub) directories

am 16.02.2005 05:37:41 von 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

Re: List (sub) directories

am 16.02.2005 05:39:49 von 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