How do you recursively delete all hidden files in a directory on UNIX?

后端 未结 6 1504
谎友^
谎友^ 2021-02-01 03:42

I have been searching for a while, but can\'t seem to get a succinct solution. I have a Mac with a folder that I want to clean of all hidden files/directories - anything hidden.

6条回答
  •  遥遥无期
    2021-02-01 04:02

    I use this command to delete empty directories. It starts at the bottom and works its way to the top. So, it won't doesn't fail if you reference the current path.

    find . -depth -type d -empty -exec rmdir {} \;
    

提交回复
热议问题