> From: Patrick Nelson <[EMAIL PROTECTED]>
> To: '[EMAIL PROTECTED]' <[EMAIL PROTECTED]>
> Subject: RE: dir listing with ls (SOLVED)
> Date: 27 Apr 2002 21:02:57 -0700
> 
> Patrick Nelson wrote:
> ----------------->>>>
> This may be really simple, but I just can't seem to get my hands around it.
> How do I get a directory listing using ls (or some other command maybe).
> All I want is the directories names (no files or .. or . ) and no other
> information, just the directory names in the current directory (not
> concerned with how the names are delimited).  I'm pulling the directory
> names into a script for processing. 
> ----------------->>>>
> Here the great advice I got.  Basically pick a output format to match your
> needs.
> 
>   find . -type d
>   find . =type d | xargs -l1 basename
>   ls . --ignore=*.*
>   ls -d */. | sed 's/..$//'
> 
> Thanks to all who replied.  I have not decided which format suits me best
> 
> 
> 
> ----
> 

Just one more opinion. My favorite method to accomplish a directory only
listing is with the following command:

  ls -l | grep ^d

As an instructor once told me, "With UNIX the answer is always YES, the
question is HOW".

Brian



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to