*BSD News Article 47037


Return to BSD News archive

Xref: sserve comp.unix.misc:17745 comp.unix.admin:30591 comp.unix.bsd:16693 comp.unix.programmer:27157 comp.unix.questions:66835 comp.unix.shell:23731
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!swidir.switch.ch!newsfeed.ACO.net!nippur.irb.hr!betty.zems.fer.hr!bzdrnja
From: bzdrnja@zems.fer.hr (Bojan Zdrnja)
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.misc,comp.unix.admin,comp.unix.bsd,comp.unix.programmer,comp.unix.questions,comp.unix.shell
Date: 17 Jul 1995 11:59:25 GMT
Organization: Linux Testing Machine at ZEMS FER Zagreb !
Lines: 25
Distribution: world
Message-ID: <3udjat$675@nippur.irb.hr>
References: <3tk3dc$4ml@rcp6.elan.af.mil> <9wspodijb6.fsf@carmen.ens-cachan.fr>
NNTP-Posting-Host: betty.zems.fer.hr
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Newsreader: TIN [version 1.2 PL2]

Vincent Zoonekynd (zoonek@Yoko.ENS-Cachan.Fr) wrote:
: >>>>> «Jay», Jay J Oh <OHJ%CSCADPS@mhs.elan.af.mil> wrote:

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

: With zsh

: ls -d */

This will work also on tcsh shells, but if your directory name begins with an
dor (.) then you won't see it. So, you can see all directories with:

ls -d .*/ */

Greets, Bojan

--
E-mail: bzdrnja@diana.zems.fer.hr   (world adress)

WHERE DREAMS COME TRUE | URL: 
AND MUSIC NEVER STOPS  | http://labs1.cc.fer.hr/~ld/