Elena' s AI Blog

MAC OS Speed Up

07 Aug 2022 (updated: 27 Jul 2026) / 6 minutes to read

Elena Daehnhardt


Flux: A MacBook on a tidy desk with a Terminal window open, a gentle stream of small file and cache icons flowing out of th...


TL;DR:
  • Tips for speeding up macOS without hardware upgrades: optimizing system performance, reducing latency, and improving computer speed through software settings and maintenance.
A Trees Admirer Hi everyone! I hope that you enjoy this summer.

I want to tell something very personal about myself (some of my readers complain that this blog is too technical). I want to share my secret with you, don't tell anyone ;) I am a secret admirer of trees and nature! I think trees speak with the Universe and can tell us about everything should we listen patiently!

Enough secrets (they might be misleading!). Let's get technical!

How to Speed Up macOS Without Hardware Upgrades

After a while, my macOS computer started to work slower. I have searched for possible solutions to run my computer faster without much latency. We can upgrade our computer storage and install a more powerful processor to speed up macOS, but hardware upgrades are costly and take time. This post instead focuses on three software-only maintenance steps that reclaim disk space and free memory:

  1. Clear macOS caches in ~/Library/Caches
  2. Empty the Trash
  3. Free RAM with the sudo purge command

Clearing macOS Caches in ~/Library/Caches

macOS caches are temporary files that apps and the system store to speed up repeat operations; over time they can grow large and consume disk space. macOS user caches live in the ~/Library/Caches folder. In Finder, choose Go > Go to Folder (or press Shift+cmd+G), type ~/Library/Caches, select all subfolders with cmd+A, and move them into the Trash. If you still need a particular cache folder, deselect it first with cmd+Mouse click.

Apple’s own storage-recovery advice leans on Optimised Storage and Safe Mode, which clear certain system caches automatically and let apps rebuild them as needed. Clearing your user caches by hand is a longstanding power-user habit rather than an Apple-documented step. It is safe in that apps simply regenerate what they need, but leave /System/Library/Caches alone, and expect the odd app to feel sluggish on its next launch while it repopulates.

Emptying the Trash to Free Disk Space

To empty the Trash, Control-click (or right-click) the Trash icon in the Dock and choose “Empty Trash,” or open the Trash in Finder and click Empty in the top-right corner. Whatever you empty is gone for good, so a quick glance through it first is not paranoia.

Freeing RAM with the sudo purge Command

sudo purge is a built-in macOS/Darwin command whose man page describes it as forcing the disk cache to be flushed, approximating the “cold cache” state your Mac has right after a fresh boot. Here’s the precise version of what that means: purge clears the file-system cache that macOS keeps sitting in otherwise-idle RAM, which is why Activity Monitor shows more memory as “free” afterwards — it does not reclaim memory a running app has actually allocated. In my experience it is a small, temporary effect, not a fix for a genuinely memory-starved Mac. If one app is hogging RAM, quitting it does far more good than purge ever will.

If you would rather skip the Terminal, third-party tools such as MacKeeper’s Memory Cleaner wrap the same idea in a GUI, for a price. To do it yourself for free, open Terminal (in Applications/Utilities), type sudo purge, and enter your administrator password when prompted — nothing echoes to the screen while you type it, which is normal.

Bash Script to Automate macOS Cleanup

This section is a command-line-friendly version of the steps described above. To automate the cleanup process, I have written a small bash script, which you can modify and adapt to your needs. Since macOS Catalina, zsh is the default interactive shell, not bash, but bash itself is still installed — save the script below and run it with bash cleanup.sh and it works regardless of which shell your Terminal opens into. Be cautious to keep the files you need: rm -rf * permanently deletes the contents of the cache folder with no confirmation and no Trash recovery.

# Go to the ~/Library/Caches folder
cd ~/Library/Caches
# Remove everything there
rm -rf *
# Empty the Trash 
rm -rf ~/.Trash/*
# RAM and caches clean up
sudo purge

Conclusion: Speeding Up macOS via Software Maintenance

These three software maintenance steps — clearing ~/Library/Caches, emptying the Trash, and running sudo purge — reclaim disk space and clear out stale caches on a slow Mac, at no cost and without a trip to the Apple Store. None of them will turn an ageing Mac into a new one, but together they buy you real breathing room. Dig into the references below for the fine print. Let me know if you have new blog topic ideas or suggestions!

Did you like this post? Please let me know if you have any comments or suggestions.

Posts about development tools and Python coding

References

1. Go directly to a specific folder on Mac – Apple Support

2. Delete files and folders on Mac – Apple Support

3. Free up storage space on Mac – Apple Support

4. purge(8) man page

5. Use zsh as the default shell on your Mac – Apple Support

6. MacKeeper Memory Cleaner

desktop bg dark

About Elena

Elena, a PhD in Computer Science, simplifies AI concepts and helps you use machine learning.

Citation
Elena Daehnhardt. (2022) 'MAC OS Speed Up', daehnhardt.com, 07 August 2022. Available at: https://daehnhardt.com/blog/2022/08/07/edaehn-mac_os_speed_up/
All Posts