[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Simple sh or alias to list directories



On Tue, 17 Oct 2000, Thomas Halahan wrote:

> I am trying to determine an easy alias or sh script that will list
> only the directories in a directory.  It should have similar
> functionality to the ls command.  E.g.
> 
> [tom]$ lsd ~

Try this one:

--<snip>--
#!/bin/sh

if [ $1 ]; then
    find $1 -maxdepth 1 -type d
else
    find $PWD -maxdepth 1 -type d
fi
--<snap>--

     Ciao,
         Timo<t_benk@gmx.de>
--

    .-'~~~-.	   
   .'o oOOOo`.      | Timo Benk	
  ;~~~-.oOo   o`.   | Germany
   `. \ ~-.  oOOo.  | Fax/Voicemail:    +49891488214215
     `.; / ~.  OO:  | 
     .'  ;-- `.o.'  | 
    ,' ; ~~--'~     | [ASCII stolen from Mescalito Ted]
    ;  ;            |  
_\\;_\\//_          



Reply to: