*BSD News Article 46502


Return to BSD News archive

#! rnews 1485 sserve.cc.adfa.oz.au
Xref: sserve comp.unix.misc:17555 comp.unix.admin:30251 comp.unix.bsd:16666 comp.unix.programmer:26815 comp.unix.questions:66337 comp.unix.shell:23423
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msunews!agate!howland.reston.ans.net!usc!news.cerf.net!nic.cerf.net!paulp
From: paulp@nic.cerf.net (Paul Phillips)
Newsgroups: comp.unix.misc,comp.unix.admin,comp.unix.bsd,comp.unix.programmer,comp.unix.questions,comp.unix.shell
Subject: Re: A Unix command to obtain directory name only
Followup-To: comp.unix.questions
Date: 7 Jul 1995 23:14:02 GMT
Organization: http://www.primus.com/staff/paulp/useless.html
Lines: 19
Message-ID: <3tkf3q$477@news.cerf.net>
References: <3tk3dc$4ml@rcp6.elan.af.mil>
NNTP-Posting-Host: nic.cerf.net

Usenet is not your personal resource: *please* do not crosspost
to every group you can think of with questions like this.

In article <3tk3dc$4ml@rcp6.elan.af.mil> Jay J Oh 
<OHJ%CSCADPS@mhs.elan.af.mil> writes:
>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.

find . -type d -maxdepth 1 -print

 -PSP

-- 
"I would rather go for having a lobotomy , for the jerk. I think
 that actually
 when he has part of his brain removed, that he will make more sense than
 he does, now." -- Andrew Beckwith, soc.culture.usa