Revive Your Slow Mac in Seconds: The Ultimate Free Terminal GUI Hack You Need to Know!

Humberto Castro
4 min readMar 14, 2023

--

Let’s face it, Macs are like the fancy sports cars of the tech world — sleek, powerful, and oh so expensive! And that’s especially true for us down here in South America. So when it comes to choosing the right Mac, we have to be strategic.

As an iOS developer, I know that having loads of RAM memory is like having a secret superpower, while SSD storage is like having a fancy but overpriced accessory.

That’s why we’ve learned to embrace the art of compromise and invest in more RAM memory instead. With only a measly 256 GB of SSD storage, we’ve become experts in optimizing our disk space. And that’s where our trusty friend, ncdu, comes in.

This tool has saved our Macs from the brink of despair and helped us keep our workspaces organized and with more disk space. So come along and let me show you how to clean up your Mac with ncdu!

Installing

First things first, let’s make sure you have Homebrew installed in your terminal. If you don’t already have it, don’t worry, it’s easy to set up. In this tutorial, I’ll walk you through the installation process step by step so you can get started with ncdu in no time.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then you just need to install the ncdu using:

brew install ncdu

With great powers come great responsibilities

As Uncle Ben once said to Spider-Man, “with great power comes great responsibility.” Well, the same goes for ncdu — it’s a tool that runs on admin and can be a real game-changer for cleaning up your Mac. But with great power comes great caution! You don’t want to accidentally erase anything important, so it’s crucial to be mindful of which folders you’re targeting.

In this tutorial, I’ll show you the folders I typically clean and how to identify the ones that are hogging up all your precious disk space. So grab your spidey-sense and let’s get started!

How to initialize

To execute the program just open your terminal and enter the following command in your terminal:

ncdu .

It will pass through a scan phase where will be found all the files on your computer. Just wait a while.

Scanning all files in your MacOS.

After a while, it will show the main folders of your Mac in order of size.

To navigate between the folders you can use your arrow keys and press d to delete any file that you want. You can search the folder that is getting more space on your computer but I will share with you what are the folders that I'm always paying attention to.

For iOS developers

For these developers, I have some extra folders that are commonly erased to free up space.

Derived data:
~/Library/Developer/Xcode/DerivedData
The derived data Xcode folder contains intermediate build artifacts used by Xcode, such as compiled object files, caches, and debug data. It is project-specific and can be safely deleted to free up space, as Xcode will automatically regenerate the necessary data during the next build.

Archives:
~/Library/Developer/Xcode/Archives
The Archive folder in Xcode stores the final build products of your project, including the compiled binary, dSYM files, and any assets required for distribution. It is a necessary step before distributing your app for testing or submitting it to the App Store. If you've already done that so you can clean up that folder.

iOS Device Logs:
~/Library/Developer/Xcode/iOS Dev Logs
The iOS Device Logs folder contains diagnostic and crash logs generated by iOS devices, providing detailed information on errors and issues. The logs are organized by device and app, accessible through Xcode’s Devices and Simulators window or the Console app on your Mac. Regularly reviewing and analyzing these logs can help troubleshoot and fix issues with your app or device. If you don't have any more problems so you can clean up this one.

iOS DeviceSupport:
~/Library/Developer/Xcode/iOS DeviceSupport
This folder contains a folder for each version of iOS you ever had on an iOS device you ever connected to while Xcode was running. Feel free to delete any folders for versions of iOS you don’t support anymore.

Using the program to delete files from any location on your machine is like swinging through the city as Spider-Man — one misstep and you could end up in a sticky situation! So, just like Spidey, it’s important to exercise caution and make sure you’re targeting the right files before hitting that delete button.

Do you have any other folders on MacOS that can be erased?
Let me know in the comments :)

I’m a freelance iOS app developer available for hire. If you need help with your next project or have an existing app that needs some attention, send me a message on my LinkedIn, and let’s get started! 😉

--

--

Humberto Castro
Humberto Castro

Written by Humberto Castro

iOS Engineer 📱 | Freelancer 🚀

Responses (1)