Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    Lightbulb Unanswered: How to list only directories

    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.

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Try:

    find . -type d


  3. #3
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    Lightbulb Your response

    find . -type d
    works fine


    but


    ls -d ./ * show even the files

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Your response

    I don't know if there is a command option to do it , but you can do

    ls -l | grep ^d

    HTH

    Cheers

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  5. #5
    Join Date
    Jul 2003
    Location
    US
    Posts
    314
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •