Created
March 14, 2021 14:07
-
-
Save mofosyne/0dceb2485dd384e2eb9e2f85cccfd774 to your computer and use it in GitHub Desktop.
Cleaning Up Empty folders in linux bash and windows batchfiles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tips in cleaning up empty folders | |
* https://stackoverflow.com/questions/30345690/git-how-to-remove-only-empty-directoriesnot-un-tracked-files-in-a-git-repo | |
* https://superuser.com/questions/444474/how-to-delete-empty-folders-from-a-given-directory-in-windows-with-a-script | |
In Linux bash | |
``` | |
find . -empty -type d -delete | |
``` | |
In Windows batchfile | |
``` | |
for /f "delims=" %%i in ('dir /s /b /ad ^| sort /r') do rd "%%i" | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment