Viewing only Directories

Viewing only Directories

am 21.01.2008 18:20:30 von Sanchit

I am Using Fedora and i want to see only directories

I am using ls -lad but it is only showing me the current directory.
SO What should I do??

Re: Viewing only Directories

am 21.01.2008 18:39:11 von Joachim Schmitz

Sanchit wrote:
> I am Using Fedora and i want to see only directories
>
> I am using ls -lad but it is only showing me the current directory.
> SO What should I do??
find . -type d -| xargs ls -lad

Bye, Jojo

Re: Viewing only Directories

am 21.01.2008 18:50:53 von Sanchit

Joachim Schmitz wrote:
> Sanchit wrote:
> > I am Using Fedora and i want to see only directories
> >
> > I am using ls -lad but it is only showing me the current directory.
> > SO What should I do??
> find . -type d -| xargs ls -lad
>
> Bye, Jojo

Thanks!

Re: Viewing only Directories

am 21.01.2008 22:58:38 von mallin.shetland

Sanchit scrisse:

> ... i want to see only directories I am using ls -lad
> ...

ls -al | grep ^d

Re: Viewing only Directories

am 21.01.2008 23:31:43 von franzi

On 21 Gen, 22:58, "mallin.shetland" wrote:
> Sanchit scrisse:
>
> > ... i want to see only directories I am using ls -lad
> > ...
>
> ls =A0-al | grep ^d

Joachim Schmitz wrote:
> Sanchit wrote:
> > I am Using Fedora and i want to see only directories
> > I am using ls -lad but it is only showing me the current directory.
> > SO What should I do??
find . -type d -| xargs ls -lad
find: -: unknown option
I do not understand why is not in posix format under macosx,dammed

Re: Viewing only Directories

am 22.01.2008 04:22:27 von mik3l3374

On Jan 22, 6:31 am, franzi wrote:
> On 21 Gen, 22:58, "mallin.shetland" wrote:
>
> > Sanchit scrisse:
>
> > > ... i want to see only directories I am using ls -lad
> > > ...
>
> > ls -al | grep ^d
> Joachim Schmitz wrote:
> > Sanchit wrote:
> > > I am Using Fedora and i want to see only directories
> > > I am using ls -lad but it is only showing me the current directory.
> > > SO What should I do??
>
> find . -type d -| xargs ls -lad
> find: -: unknown option
> I do not understand why is not in posix format under macosx,dammed

remove the "-" after the "d".
find . -type d | xargs ls -lad

Re: Viewing only Directories

am 22.01.2008 04:23:47 von mik3l3374

On Jan 22, 1:20 am, Sanchit wrote:
> I am Using Fedora and i want to see only directories
>
> I am using ls -lad but it is only showing me the current directory.
> SO What should I do??

ls -p|grep "/"

Re: Viewing only Directories

am 22.01.2008 08:06:44 von Joachim Schmitz

franzi wrote:
> On 21 Gen, 22:58, "mallin.shetland" wrote:
>> Sanchit scrisse:
>>
>>> ... i want to see only directories I am using ls -lad
>>> ...
>>
>> ls -al | grep ^d
>
> Joachim Schmitz wrote:
>> Sanchit wrote:
>>> I am Using Fedora and i want to see only directories
>>> I am using ls -lad but it is only showing me the current directory.
>>> SO What should I do??
> find . -type d -| xargs ls -lad
> find: -: unknown option
That additional - was a typo of mine...

> I do not understand why is not in posix format under macosx,dammed

Bye, Jojo

Re: Viewing only Directories

am 22.01.2008 10:43:32 von ashokpj

On Jan 21, 10:20=A0pm, Sanchit wrote:
> I am Using Fedora and i want to see only directories
>
> I am using ls -lad =A0but it is only showing me the current directory.
> SO What should I do??

try this : ls -l | grep ^d (or) ls -Rl | grep ^d

Re: Viewing only Directories

am 22.01.2008 11:46:51 von Maxwell Lol

ashokpj@gmail.com writes:

> On Jan 21, 10:20 pm, Sanchit wrote:
> > I am Using Fedora and i want to see only directories
> >
> > I am using ls -lad  but it is only showing me the current directory.
> > SO What should I do??
>
> try this : ls -l | grep ^d (or) ls -Rl | grep ^d

You can also get the names and sizes of the directories by the "du" command.

Re: Viewing only Directories

am 22.01.2008 13:45:01 von Stephane CHAZELAS

On Mon, 21 Jan 2008 09:20:30 -0800 (PST), Sanchit wrote:
> I am Using Fedora and i want to see only directories
>
> I am using ls -lad but it is only showing me the current directory.
> SO What should I do??

ls -ld -- */ .*/

will work in most shells. Wether "." and ".." are output is
shell dependant.

In zsh:

ls -ld -- *(D/)

(D) to include dot files.
(/) to select directories only.
(note that zsh won't expand "." and ".." there).

If you're also interested in symlinks to directories:

ls -Lld -- *(D-/)

--
Stephane

Re: Viewing only Directories

am 22.01.2008 15:42:25 von hyperboogie

if you just want the directory names without the long format:

ls -F | grep '/$'

If you have the markdirs option on, you can also use:

ls -d */

Re: Viewing only Directories

am 22.01.2008 15:58:47 von Stephane CHAZELAS

On Tue, 22 Jan 2008 06:42:25 -0800 (PST), hyperboogie wrote:
> if you just want the directory names without the long format:
>
> ls -F | grep '/$'
>
> If you have the markdirs option on, you can also use:
>
> ls -d */

markdirs, which is a zsh option only, is only to add a "/" upon
the filename generation to the directory names.

ls -d */

will work regardless of the markdirs option in most shells..

However, the above will not work correctly if some of the
directory names start with "-", hence:

ls -d -- */

(it won't list hidden dirs).

See also:

printf '%s\n' */

(as globbing is doing the directory listing, ls is no longer
required).

--
Stephane

Re: Viewing only Directories

am 23.01.2008 22:26:37 von Michal Nazarewicz

Sanchit writes:

> I am Using Fedora and i want to see only directories
>
> I am using ls -lad but it is only showing me the current directory.
> SO What should I do??

ls -lad */

--
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +------ooO--(_)--Ooo--

Re: Viewing only Directories

am 25.01.2008 21:38:43 von brian_hiles

Stephane Chazelas wrote:
> hyperboogie wrote:
> ...
> markdirs, which is a zsh option only, is only to add a "/" upon
> the filename generation to the directory names.
> ...

ksh(1) version 1988 and newer implements a "markdirs" shell option:

set -o markdirs

=Brian