Published on

How to remove unused files on macOS to shrink system data size

To my surprise, I'm reading article on internet, and find system become slower and slower then there's a notification popuup to show This disk is almost full

It's annoying message, ever I had cleaned it just a few weeks ago, and don't know why it sucks again.

After some googling, I find this command line to find the largest directories so you can remove them to get more free spaces.

du -sh *

Firstly, you enter the root directory

cd /

then run this

du -sh *

you can get the size of each directory in the first level, then you can iterate for each large directory to find the very directory or files you look for.

Following the output, I find lots of unused git repositories and after I remove them there's 60GB free space back!

No CleanMyMac, or any other third party softeware, you can do it by yourself!