Listing directories and sub directories

Hey there, i am trying to list all the directories and sub directories of a file system, but am having a bit of trouble.

ls -lR|grep \/|grep '^\.' >> input.dat

i used this statement to list all the directories and sub directories and output them to a file
when i try to print them out on the screen it works fine

But when i try to put them to a output file, it doesnt work

Can anyone explain me why??

U tried your command and it works fine. I can see the output in a file as well.

It works for me fine on solaris host. Do you have a permission to create a file in this directory? Or if the file already exists - do you have permission to write to it? Maybe you have some acl set on the file?

Regards,

-Oktawik.

Just a side note:

If I understand what you're trying to do, it would be easier to use:

find . -type d

ShawnMilo