Tags | |

Find and delete emtpy directories

If you have a directory that has many empty folders just taking up space, you can use the following command to clear the empty directories recursively.




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


In short that looks in /path for directories that are empty then executes the command rmdir.



Comments

Feel free to leave a comment or question

Name: (Optional but appreciated):

Comment:

Use [code] [/code] for code block style



Security Code: