Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sdd.hp.com!uakari.primate.wisc.edu!aplcen!wb3ffv!ka3ovk!raysnec!shwake From: shwake@raysnec.UUCP (Ray Shwake) Newsgroups: comp.unix.questions Subject: Re: Can ls be made to only list directories? Message-ID: <57@raysnec.UUCP> Date: 4 Sep 90 19:19:30 GMT References: <90243.151817SML108@psuvm.psu.edu> <13725@smoke.BRL.MIL> Organization: IRS/CI - Technical Solutions Branch Lines: 15 Create a shell script - call it dirs - then run "dirs *" for i in `file $* | fgrep directory | sed 's/\([^:]*\):.*/\1/'` do /bin/echo "$i \c" # feel free to modify for built-in echo done echo One can then run, for example: ls `dirs [a-z]*` Variants are possible for other file types (like text, for example). Of course, there are a few LS variants around supporting the -D option. In which case, (well, you can finish this one yourself!)