*BSD News Article 47142


Return to BSD News archive

Xref: sserve comp.unix.bsd:16697 comp.unix.programmer:27206 comp.unix.questions:66918 comp.unix.shell:23775
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!daffy!uwvax!uchinews!vixen.cso.uiuc.edu!howland.reston.ans.net!news.nic.surfnet.nl!sun4nl!phcoms4.seri.philips.nl!TISP05
From: J.M.Burgers@nl.cis.philips.com (J.M. Burgers)
Newsgroups: comp.unix.bsd,comp.unix.programmer,comp.unix.questions,comp.unix.shell
Subject: Re: A Unix command to obtain directory name only
Date: Fri, 21 Jul 95 16:53:12 GMT
Organization: Philips
Lines: 16
Distribution: world
Message-ID: <3uof3h$lsk@phcoms4.seri.philips.nl>
References: <3tk3dc$4ml@rcp6.elan.af.mil> <DBvnro.oy@sneaky.lonestar.org>
NNTP-Posting-Host: 130.144.85.59
X-Newsreader: News Xpress Version 1.0 Beta #2.1

gordon@sneaky.lonestar.org (Gordon Burditt) wrote:
>>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
Try
file * | grep dir
Greetings hans