How to exclude this / current / dot folder from find “type d”

后端 未结 4 1944
一向
一向 2020-11-30 19:38
find . -type d

can be used to find all directories below some start point. But it returns the current directory (.) too, which may be

4条回答
  •  旧时难觅i
    2020-11-30 20:00

    Well, a simple workaround as well (the solution was not working for me on windows git bash)

    find * -type d

    It might not be very performant, but gets the job done, and it's what we need sometimes.

    [Edit] : As @AlexanderMills commented it will not show up hidden directories in the root location (eg ./.hidden), but it will show hidden subdirectories (eg. ./folder/.hiddenSub). [Tested with git bash on windows]

提交回复
热议问题