You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How can I identify all the empty folders on my iMac?

How can I identify all the empty folders on my iMac so that I can delete them so that they don't get copied to the next iMac that I buy?


[Re-Titled by Moderator]

iMac 27″, macOS 10.15

Posted on Feb 23, 2022 12:37 PM

Reply
Question marked as Top-ranking reply

Posted on Feb 24, 2022 10:29 AM

Because I am little bit obsessive-compulsive I have two external drives for backup - one for Time Machine and one for Carbon Copy Cloner -


That's all? 😄


I really, really wouldn't concern myself with empty folders. Not only is the space they occupy negligible, they are only backed up once. The same goes for any file that remains unchanged. Only one backup copy exists, no matter how long the TM history may be.


The other reason is that although most Mac apps (and in fact, every Mac app that I experimented with on this Mac before providing my reply) will not let you delete a folder, even an empty one, if it is required by that app. Attempting to delete it will result in "permission denied" or words to that effect. Of course I have no idea whether you have and depend upon some apps that aren't as well thought-out. As a matter of fact many years ago I deleted some empty Library folders for reasons similar to yours, and was rewarded by a runaway macOS process that (apparently) depended on their presence. As a result the Mac began to perform poorly. Manually recreating that completely empty folder fixed the runaway process.


Recent macOS versions protect themselves against such user-inflicted damage, so you can't do what I did any more. It's just an example.

5 replies
Question marked as Top-ranking reply

Feb 24, 2022 10:29 AM in response to dlp1962uva

Because I am little bit obsessive-compulsive I have two external drives for backup - one for Time Machine and one for Carbon Copy Cloner -


That's all? 😄


I really, really wouldn't concern myself with empty folders. Not only is the space they occupy negligible, they are only backed up once. The same goes for any file that remains unchanged. Only one backup copy exists, no matter how long the TM history may be.


The other reason is that although most Mac apps (and in fact, every Mac app that I experimented with on this Mac before providing my reply) will not let you delete a folder, even an empty one, if it is required by that app. Attempting to delete it will result in "permission denied" or words to that effect. Of course I have no idea whether you have and depend upon some apps that aren't as well thought-out. As a matter of fact many years ago I deleted some empty Library folders for reasons similar to yours, and was rewarded by a runaway macOS process that (apparently) depended on their presence. As a result the Mac began to perform poorly. Manually recreating that completely empty folder fixed the runaway process.


Recent macOS versions protect themselves against such user-inflicted damage, so you can't do what I did any more. It's just an example.

Feb 23, 2022 1:50 PM in response to dlp1962uva

Sure, but I recommend deleting only empty folders that reside in your Home directory and its subdirectories.


Important: Read the caveat at the end of this reply before doing anything. Don't say I didn't warn you.


Use the Terminal app: Terminal User Guide for Mac - Apple Support


find /Users/john -type d -empty


... where "john" is your "short user name".


The above example will show you all the empty folders in your Home directory including all its subdirectories.


Once you see how many there are, you might want to think twice about deleting all of them. The reason is that some apps might not cope well with directories that it expects to be present, even though they may be empty. Certain apps are certain to be sloppier than others in that regard, but really well-written and robust apps are rare.


After giving that caveat some well-deserved consideration, you can modify the above command to delete them:


find /Users/john -type d -empty -delete


... and just like that, they'll be gone.


There is no "undo", so if you mess up the above command or it deletes an empty folder that an app nevertheless requires to be present, your only recourse is to restore a Time Machine backup. To learn how to use Time Machine please read Back up your files with Time Machine on Mac.

Feb 24, 2022 1:04 PM in response to dlp1962uva

I saw your question and remembered I'd seen it answered in another discussion. Here it is:

Empty folders 


Sure, but I recommend deleting only empty folders that reside in your Home directory and its subdirectories. 


Important: Read the caveat at the end of this reply before doing anything. Don't say I didn't warn you.


Use the Terminal app: Terminal User Guide for Mac - Apple Support


find /Users/john -type d -empty


... where "john" is your "short user name".


The above example will show you all the empty folders in your Home directory including all its subdirectories. 


Once you see how many there are, you might want to think twice about deleting all of them. The reason is that some apps might not cope well with directories that it expects to be present, even though they may be empty. Certain apps are certain to be sloppier than others in that regard, but really well-written and robust apps are rare.


After giving that caveat some well-deserved consideration, you can modify the above command to delete them:


find /Users/john -type d -empty -delete


... and just like that, they'll be gone. 


There is no "undo", so if you mess up the above command or it deletes an empty folder that an app nevertheless requires to be present, your only recourse is to restore a Time Machine backup. To learn how to use Time Machine please read Back up your files with Time Machine on Mac.


Credit goes to John Galt’s Profile - Apple Community

Feb 24, 2022 10:00 AM in response to Ronasara

There are over 33,000 folders with a size of ".." on my system. A total of 1,230 have folder names that I recognize. Because I am little bit obsessive-compulsive I have two external drives for backup - one for Time Machine and one for Carbon Copy Cloner - so there are three replicates for many of these folders. If I don't delete these 1,230, and I am looking for a file that should have been in one of them, I have to try to open the folder only to find that it is empty. Which is frustrating. But I would rather be safe than sorry, so I will probably wait until I get my next iMac and have the local dealer take care of eliminating the empty folders that are not essential to the operating system or an app.


So, thanks for the warning.

How can I identify all the empty folders on my iMac?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.