Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!pacbell.com!pacbell!sactoh0!jak From: jak@sactoh0.SAC.CA.US (Jay A. Konigsberg) Newsgroups: comp.unix.questions Subject: Re: Can ls be made to only list directories? Message-ID: <3871@sactoh0.SAC.CA.US> Date: 2 Sep 90 14:18:03 GMT References: <90243.151817SML108@psuvm.psu.edu> <13725@smoke.BRL.MIL> Organization: Sacramento Public Access Unix, Sacramento, Ca. Lines: 14 >In article <90243.151817SML108@psuvm.psu.edu> SML108@psuvm.psu.edu (Scott the Great) writes: >As the subject asks, is there a set of options which will limit >ls to listing directories? A simple solution is to pipe the output of 'ls -l' through 'grep' and anchor the leading "d" in "drwxrwxrwx" to the begining of the string. ls -l | grep "^d" -- ------------------------------------------------------------- Jay @ SAC-UNIX, Sacramento, Ca. UUCP=...pacbell!sactoh0!jak If something is worth doing, its worth doing correctly.