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?
ls
You can use the tree command with its d switch to accomplish this.
tree
d
% tree -d tstdir tstdir |-- d1 | `-- d11 | `-- d111 `-- d2 `-- d21 `-- d211 6 directories
see man tree for more info.
man tree