Listing only directories in UNIX

前端 未结 20 899
青春惊慌失措
青春惊慌失措 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:08

    This has been working for me:

    `ls -F | grep /`
    

    (But, I am switching to echo */ as mentioned by @nos)

提交回复
热议问题