[PLUG] ls -d does not work as it should

Brian Stanaland brian at stanaland.org
Mon Jun 25 23:38:15 UTC 2018


I don't understand why this works but...

ls -d */

[root at li1233-197 log]# ls -d */
anaconda/  audit/  chrony/  httpd/  rhsm/  sa/  tuned/

Brian


On Mon, Jun 25, 2018 at 7:34 PM, John Meissen <john at meissen.org> wrote:

>
> rshepard at appl-ecosys.com said:
> >    What option would you use to list only subdirectories and not files
> in the
> > cwd or the subdirectories?
>
> I generally take the easy way and just do
>   ls -l | grep drw
>
> You could do
>   find . -type d -maxdepth 1
>
> Or if you want it sorted,
>   find . -type d -maxdepth 1 | sort
>
> Each has it's own quirks.
>
>
>
> _______________________________________________
> PLUG mailing list
> PLUG at pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>



-- 
"Anyone who has never made a mistake has never tried anything new." -Albert
Einstein



More information about the PLUG mailing list