ls -d doesn't work on Solaris

Hello, the ls -d command to only list directories in a directory doesn't seem to work on Solaris and the man command says to use that combination: ls -d

Anyone have the same problem and find a resolve?

Thanks
BobK

"ls -d" doesn't display directories. Is used to list directory's name instead of directory's content if the argument passed to ls is a directory.

For example, if you have a directory called TEST and you issue "ls TEST", you will see the list of files in that directory. If you issue "ls -d TEST" you will see only the name of the directory you searched for (TEST).

If you want to display directories try:

ls -p | grep "/$"

thanks ROBOTRONIC! works great, i've been trying to figure that one out for several years believe it or not and now i really need it cos i've got some dirs with hundreds of files in it and can find the dirs easily!\

have a great week/end ROBOTRONIC!

BobK

you can also use ls -l |grep ^d
for a long list od directories

thanks DAVEBEYOU! that works too!:stuck_out_tongue:

Or simply:

printf "%s\n" */

chck dis out for displayin all the directories

ls -l | grep '^d'

and ls -d is to display directory entries....not directories

thanks again all ! this forum is beyond awesome!!! :b:

ls -pm|grep / :cool:

great thanks!

have a good one!:stuck_out_tongue: