[PLUG] not embarassed to ask a basic

Russell Senior seniorr at aracnet.com
Sun Oct 7 20:17:19 UTC 2007


>>>>> "Richard" == Richard M Lidzbarski (Rick) <eikonoklastic at comcast.net> writes:

Richard> How do you use the ls command to list ONLY directories, no
Richard> files?

There are many ways to do most things, but here are two I came up with
right away:

  $ find -maxdepth 1 -type d

or if you really want to use ls, something like this:

  $ ls -p1 | grep '/$' | sed 's|/$||'


-- 
Russell Senior         ``I have nine fingers; you have ten.''
seniorr at aracnet.com



More information about the PLUG mailing list