You may have a lot of empty folders on your Mac. If you want to tidy up your Mac, finding and deleting these empty folders is an easy process. Sometimes you may create these folders and forget about them, and sometimes the apps you install create and leave them behind. The empty folders take up little storage space, but you may want to find and delete them to keep your computer more organized. In this article, I describe how you can do this. By following the steps below, you will be able to find all the empty folders in the Home directory, including all its subdirectories.
As I stated above, finding empty folders is easy. For this, we will be using Terminal. But, just as a warning, I advise you to be careful before deleting them, because some apps may want to have that folder, even if it is empty. Deleting the folder may cause the app to malfunction. I will explain this more below.
Find and delete empty folders
As I said above, this article describes finding the empty folders in your Home directory. Of course, you can adjust the command line below to change the directory. But, especially if you are deleting folders, I do not recommend messing with directories outside of your Home directory unless you have a good idea of what you are doing. The Home folder contains many subfolders, including: Applications, Desktop, Documents, Downloads, My Games, Movies, Music, Pictures and Public. Here is how you can find the empty folders:
- Open Terminal on your Mac. Terminal is located in Applications > Utilities. You can just press Command (⌘) – Space Bar, then type Terminal.
- Enter the following command, then hit enter. You may be asked to give Terminal permission to access certain subfolders. Please note that in the screenshot, serhatkurt is the Home folder, and in the code box below, macreports is the Home folder. Replace it with the name of your Home directory. If you do not know yours, there are a few ways to figure it out, which I will explain in the section below.
find /Users/macreports -type d -empty
- Terminal will list all empty folders and subfolders. You will probably see many lines scroll by in Terminal while these folders are being found. You can delete them all easily, if you really want to do that. Again, this may cause issues later with some apps, if you delete a folder the app wants to use. We really recommend you do a full backup before you delete anything. If you want to delete all of the empty folders in your Home directory, type the following command and hit enter. Again, replace macreports with your Home directory name:
- All of these empty directories will be gone in a few seconds. There is no undo option. They will be gone. The only way to bring them back is to restore your Mac from a backup, like a Time Machine backup, if you have one.
find /Users/macreports -type d -empty -delete
Find the name of your Home directory
If you do not know the Home directory’s short name, follow these steps:
- Open a Finder window.
- From the menu bar at the top of your screen, click Go, then select Home.
- You will see your Home directory’s name at the top of the Finder window.