I want to list only the directories in specified path (ls doesn\'t have such option).
Also, can this be done with a single line command?
find specifiedpath -type d
If you don't want to recurse in subdirectories, you can do this instead:
find specifiedpath -type d -mindepth 1 -maxdepth 1
Note that "dot" directories (whose name start with .) will be listed too; but not the special directories . nor ... If you don't want "dot" directories, you can just grep them out:
find specifiedpath -type d -mindepth 1 -maxdepth 1 | grep -v '^\.'