*BSD News Article 46521


Return to BSD News archive

Xref: sserve comp.unix.misc:17557 comp.unix.admin:30255 comp.unix.bsd:16667 comp.unix.programmer:26817 comp.unix.questions:66343 comp.unix.shell:23426
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msunews!agate!howland.reston.ans.net!Germany.EU.net!nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!news.rrz.Uni-Koeln.DE!sinder
From: sinder@harpo.rrz.uni-koeln.de (Andreas Sindermann)
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
Date: 07 Jul 1995 23:33:28 GMT
Organization: Regional Computing Center, University of Cologne, Germany
Lines: 11
Message-ID: <SINDER.95Jul8013328@harpo.rrz.uni-koeln.de>
References: <3tk3dc$4ml@rcp6.elan.af.mil>
NNTP-Posting-Host: harpo.rrz.uni-koeln.de
In-reply-to: Jay J Oh's message of 7 Jul 1995 19:54:20 GMT

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.

How about 'find . -type d -maxdepth 1 -print'?

Andreas
--
sinder@rrz.uni-koeln.de