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

Re: Listing directories with ls?



I humbly stand corrected.  I performed the command and did not pay
attention that it was the root directory. :)  I silently/humbly retreat.


-Tim


On Mon, 16 Dec 2002, Oisin C. Feeley wrote:

>
>
> On Mon, 16 Dec 2002, Tim Miller wrote:
>
> >
> >ls -lp / will provide a listing of the only the sub-directories of the
> >current directory.  I just performed this on my RH 7.3 box and it worked.
> >
> >Try it. ;)
> >
> >- Tim
> >
> >On Mon, 16 Dec 2002, Oisin C. Feeley wrote:
> >
> >>
> >>
> >> On Mon, 16 Dec 2002, Tim Miller wrote:
> >>
> >> >
> >> >ls -lp /
> >> >
> >> >- Tim
> >> >
> >> >
> >> >On Mon, 16 Dec 2002, Dan G wrote:
> >> >
> >> >> Is there a simple way to list only directories under a specific directory
> >> >> tree using the ls command? I know I can do this by using -type d with the
> >> >> find command or by doing ls -la|grep d as well. I am wondering if there is a
> >> >> simple way to do this just using ls? ls -ld only lists directory entries. I
> >> >> am not looking for a recursive search here just a way to separate files from
> >> >> dirs in the output so only dir entries show.
> >> >>
> >>
> >> No, "ls -lp" just appends an identifier.  It's still going to also
> >> output the list of non-directory files.  I think the "find" option may
> >> be the only way to go.
> >>
>
> No, "ls -lp /" will provide a listing of the directories under slash.
> As there are no ordinary files under slash then you'll only see
> directories.  If I execute "ls -lp <SOMEDIR>" on some directory that
> contains files AND other types of file then I see ALL the files, not
> ONLY the directories.  Try it. ;)
>
> Best wishes,
> Oisin Feeley
>
>
>
> _______________________________________________
> Valhalla-list mailing list
> Valhalla-list redhat com
> https://listman.redhat.com/mailman/listinfo/valhalla-list
>





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