List (sub) directories
am 15.02.2005 20:23:28 von 50295Is there a command like ls that lists only the sub-directores of the
current dirctory? I am not interested in files
Thanks,
- Olumide
Is there a command like ls that lists only the sub-directores of the
current dirctory? I am not interested in files
Thanks,
- Olumide
Zawarto¶æ nag³ówka ["Followup-To:" comp.unix.shell.]
On 2005-02-15, 50295@web.de wrote:
> Is there a command like ls that lists only the sub-directores of the
> current dirctory? I am not interested in files
find . -type d
--
Feel free to correct my English.
Stanislaw Klekot
Thus spake 50295@web.de (50295@web.de):
> Is there a command like ls that lists only the sub-directores of the
> current dirctory? I am not interested in files
Use Zsh: `ls -ld **/*(/)'
In article <1108495408.063443.176890@o13g2000cwo.googlegroups.com>,
<50295@web.de> wrote:
>Is there a command like ls that lists only the sub-directores of the
>current dirctory? I am not interested in files
>
something like:
ls -ld |grep ^d
perhaps?
On 15 Feb 2005 11:23:28 -0800,
50295@web.de (50295@web.de) wrote:
> Is there a command like ls that lists only the sub-directores of the
> current dirctory? I am not interested in files
>
`find . -type d` will recursively find all the sub-directories of the
current directory.
`find . -type d -maxdepth 1` will restrict the search & results to just
the sub-directories of the current directory.
Beverly
--
Many a smale maketh a grate -- Geoffrey Chaucer
On Tue, 15 Feb 2005 at 19:23 GMT, 50295@web.de wrote:
> Is there a command like ls that lists only the sub-directores of the
> current dirctory? I am not interested in files
In a POSIX shell (bash, ksh, ash, etc):
ls */
In a Bourne shell:
ls */.
--
Chris F.A. Johnson http://cfaj.freeshell.org/shell
============================================================ =======
My code (if any) in this post is copyright 2005, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
On Wed, 16 Feb 2005 at 04:32 GMT, Chris F.A. Johnson wrote:
> On Tue, 15 Feb 2005 at 19:23 GMT, 50295@web.de wrote:
>> Is there a command like ls that lists only the sub-directores of the
>> current dirctory? I am not interested in files
>
> In a POSIX shell (bash, ksh, ash, etc):
>
> ls */
>
> In a Bourne shell:
>
> ls */.
You will probably want to use the -d option with those:
ls -d */
ld -d */.
--
Chris F.A. Johnson http://cfaj.freeshell.org/shell
============================================================ =======
My code (if any) in this post is copyright 2005, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
In article <1108495408.063443.176890@o13g2000cwo.googlegroups.com>,
<50295@web.de> wrote:
>Is there a command like ls that lists only the sub-directores of the
>current dirctory? I am not interested in files
for i in *; do
[[ -d $i ]] && print -- "$i"
done
--
For low fair air travel, take Independence Air - http://www.flyi.com/.
Michael Wang * http://www.unixlabplus.com/ * mwang@unixlabplus.com