PDA

View Full Version : How to list only directories


aruneeshsalhotr
07-11-03, 16:13
Hi
I had a basic question on Unix.
I know in DOS, one could use dir /ad to list only directories in a given path.

I wanted to know what is the equivalent command in UNIX for the same.

LKBrwn_DBA
07-11-03, 17:53
Try:

find . -type d

aruneeshsalhotr
07-11-03, 18:00
find . -type d
works fine


but


ls -d ./ * show even the files

sathyaram_s
07-11-03, 20:08
I don't know if there is a command option to do it , but you can do

ls -l | grep ^d

HTH

Cheers

Sathyaram

aruneeshsalhotr
07-11-03, 20:10
Hi Satya
That command really did the job.

I have the command in one of the postits, before I get handy.

Thanx and Regards
Aruneesh