Listing only directories in UNIX

前端 未结 20 892
青春惊慌失措
青春惊慌失措 2020-12-12 09:40

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?

20条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-12 10:16

    ls -l | grep '^d'
    

    You can make an alias and put it into the profile file

    alias ld="ls -l| grep '^d'"
    

提交回复
热议问题