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 ls -d */ or tree -d
ls -d */
tree -d
Another solution would be globbing but this depends on the shell you are using and if globbing for directories is supported.
For example ZSH:
zsh # ls *(/)