Command to list only directory names under Linux

Sometimes you need to only only list the directory names under Linux, to do this simply use :-

Show Plain Text
Text code
  1. ls -d */

Alternative commands you can use are :-

Show Plain Text
Text code
  1. find . -type d -exec ls -d {} \;
  2. ls -d .*"/" *"/"
  3. find . -type d

Fairly simple stuff but it'll save me remembering next time, with any luck.

Filed under: Linux  Tags: Debian, Ubuntu

0 Responses to “Command to list only directory names under Linux”

Sorry, comments have been closed for this post.