On Wed, Jan 30, 2002 at 11:35:17AM -0700, Byron Clark wrote:
> Another way to do this would be to use
> 
> ls -ap | grep /
> 
> --byron
> 
> On Wed, 2002-01-30 at 10:20, Corey Edwards wrote:
> > --- "M. Ryan Byrd" <[EMAIL PROTECTED]> wrote:
> > >  So I want to only list the directories in a certain directory so I man ls
> > >  and it says:
> > > 
> > >  ls -d list directories' names, not their contents
> > 
> > Normally ls will show directory contents. But 'ls -d' doesn't say to show all
> > the directories. I can't think of a good way to do this, but here's what
> > I came up with:
> > 
> > lsd(){ for i in $(ls); do if [ -d $i ]; then echo $i; fi done }
> > 
> > Then do 'lsd' and it should do what you expect.
> > 
> > Corey

Or, how about:

find . -maxdepth 1 -type d -printf "%f\n"

The find command is very cool for listing stuff.

                --Levi
--------------------------------------------------------------------------------- 
To unsubscribe from the BYU UUG discussion mailist list, send email to
[EMAIL PROTECTED] with the word "UNSUBSCRIBE" as the message body

Reply via email to