Complete.Org: Mailing Lists: Archives: discussion: June 2001:
[aclug-L] Re: dumb question again
Home

[aclug-L] Re: dumb question again

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: discussion@xxxxxxxxx
Subject: [aclug-L] Re: dumb question again
From: John Reinke <jmreinke@xxxxxxxxx>
Date: Sat, 23 Jun 2001 03:15:12 -0500
Reply-to: discussion@xxxxxxxxx

> is that any flag can use on ls to show a list of
>directory name only?
>
>mysystem>ls -la
>drwxr-x-r-x ... ...   ... dir1
>drwxr-x-r-x ... ...   ... anotherdir
>-rwxr-x-r-x ... ...   ... file1
>-rwxr-x-r-x ... ...   ... anotherfile

If you don't see an option for this in your ls man page or from 'ls
--help', you'll need to use a pipe or create a shell alias. I've not seen
an option for it, but it isn't really much more typing to pipe to grep:

ls -la | grep ^d

where grep only prints the lines that begin with a 'd'.

>I want to type a ls command (without using pipe)
>show only
>dir1/
>anotherdir/

Once again, the pipe method:

ls -F | grep /$

Of course, many other approaches could give the same output, but it doesn't
get much simpler than that...

John

>I don't want to see files or the other coloum
>any easy way to do? I know that using pipe and grep
>can
>make it work and sed... I just wonder ls with some
>parameter can make it works..
>
>Thanks.
>Mav


-- This is the discussion@xxxxxxxxx list.  To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]