Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to list directory

0 views
Skip to first unread message

Dean Couple

unread,
Jan 31, 2003, 10:49:34 PM1/31/03
to
When type "ls -l", all directories and files are listed. If I only
want to list directories, how to do it? Thanks!

Michael Heiming

unread,
Feb 1, 2003, 12:44:18 AM2/1/03
to
Dean Couple <obj...@sagenaut.com> wrote:
> When type "ls -l", all directories and files are listed. If I only
> want to list directories, how to do it? Thanks!

For beginners:
$ ls -l | grep "^d"

Michael Heiming
--
Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of SPAM

Chris F.A. Johnson

unread,
Feb 1, 2003, 2:41:40 AM2/1/03
to
On Sat, 01 Feb 2003 at 05:44 GMT, Michael Heiming wrote:
> Dean Couple <obj...@sagenaut.com> wrote:
>> When type "ls -l", all directories and files are listed. If I only
>> want to list directories, how to do it? Thanks!
>
> For beginners:
> $ ls -l | grep "^d"

In some shells:

ls -ld */

--
Chris F.A. Johnson http://cfaj.freeshell.org
===================================================================
My code (if any) in this post is copyright 2003, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License

Desmond Coughlan

unread,
Feb 1, 2003, 3:45:39 AM2/1/03
to
le 31 Jan 2003 19:49:34 -0800, dans l'article <aed59c32.03013...@posting.google.com>, Dean Couple <obj...@sagenaut.com> a dit ...

> When type "ls -l", all directories and files are listed. If I only
> want to list directories, how to do it? Thanks!

ls -Fl | grep \/

--
Desmond Coughlan
desmond @ zeouane.org
http: // www . zeouane . org

Kat Orlog

unread,
Feb 1, 2003, 12:16:15 PM2/1/03
to
Michael Heiming <michael...@www.heiming.de> wrote in message news:<irmf1b...@news.heiming.de>...

> Dean Couple <obj...@sagenaut.com> wrote:
> > When type "ls -l", all directories and files are listed. If I only
> > want to list directories, how to do it? Thanks!
>
> For beginners:
> $ ls -l | grep "^d"
>
> Michael Heiming

What do advanced users do?

Bit Twister

unread,
Feb 1, 2003, 12:21:56 PM2/1/03
to

man ls :)
man grep :)

0 new messages