*BSD News Article 47150


Return to BSD News archive

Xref: sserve comp.unix.bsd:16696 comp.unix.programmer:27203 comp.unix.questions:66916 comp.unix.shell:23774
Newsgroups: comp.unix.bsd,comp.unix.programmer,comp.unix.questions,comp.unix.shell
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.sprintlink.net!news.onramp.net!lerami!rwsys!nemesis!hammy!gordon
From: gordon@sneaky.lonestar.org (Gordon Burditt)
Subject: Re: A Unix command to obtain directory name only
Organization: "Gordon Burditt"
Message-ID: <DBvnro.oy@sneaky.lonestar.org>
References: <3tk3dc$4ml@rcp6.elan.af.mil>
Date: Mon, 17 Jul 1995 20:33:23 GMT
Lines: 11

>I am trying to invoke a unix command to obtain only directory names 
>listing for a given path.  I tried using 'ls -d *', but this includes 
>files also.  I also tried 'find -type d . -print'  but this command 
>recursively list all the subdirectories, which I don't want.

Try:

	ls -d */.

						Gordon L. Burditt
						sneaky.lonestar.org!gordon