[Gllug] Locating Subdirectories
Liam Delahunty
liamvictor at gmail.com
Tue Jul 27 11:15:45 UTC 2004
On Tue, 27 Jul 2004 12:04:29 +0100, John Hearns
<john.hearns at clustervision.com> wrote:
> On Tue, 2004-07-27 at 11:51, Mick Farmer wrote:
> > Dear GLLUGers,
> >
> > I need to obtain the names of all the subdirectories in the
> > current directory. I'm currently using the following.
> >
> > find * -type d -maxdepth 0
> >
> > Does anyone have anything simpler?
> >
> Nope, but for fun way more complicated:
> ls --directory -l * | grep ^d | sed 's/ \+/ /g' | cut -f 9 -d ' '
>
du --max-depth=1 | awk '{print $2}' | cut -b3-
and gets hidden dirs. (cut -b3- to get rid of the ./ at start of line)
--
Kind regards, Liam Delahunty
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list