9

How to locate and delete empty files and directories

view full story
linux-howto

http://www.linuxandlife.com – Chance is that there will be empty files (zero byte files) and empty directories (that doesn’t contain any files) in your system. In this article, I will show you how to locate these empty directories and files and delete them. The command you can use is the "find" command. To find empty directories in the current directory, you use the option -empty: find . -type d -empty To remove all these empty directories in the current directory, the command you can use is: find . -type d -empty -exec rmdir {} \; The option -empty is also used to find empty files inside the current direct (Distributions)