[PLUG] Listing only directory names

R Haack gluebert at comcast.net
Thu Mar 10 17:10:05 UTC 2005


Rich,

Try this, I think it's what you want.

ls -la | grep ^d

Robert Haack

>   I have just re-read the 'ls' man page but do not see an option that 
> will
> let me view only the names of subdirectories and not the individual 
> files.
> Tried piping the output of 'ls' to 'file' and grep'ing that for the 'd'
> marker, but did not have the proper options for file on the command line.
>
>   What is the shell solution to listing only subdirectories within a
> directory?
>
> Thanks,
>
> Rich
>




More information about the PLUG mailing list