Stop paying for Mac cleaners: Use this free command-line tool instead

5 days ago 14
M5 MacBook Pro
Kerry Wan/ZDNET

ZDNET key takeaways

  • There's no need to purchase pricey apps to clean your Mac.
  • Mole is a command-line tool that does a great job.
  • Mole is free and can be installed with Homebrew.

Because I work with a lot of video, my Mac drives can fill quickly. When that happens, things can get a bit tricky. The machine might slow down, or I won't be able to create or save files.

Before that situation arises, I like to clean my Mac drives of unnecessary items. When I do that task, I turn to a handy command-line tool called Mole.

Also: I've tried nearly every browser out there and these are my top 4 (spoiler: none are Chrome)

Mole deep cleans and optimizes your Mac, without you having to install expensive solutions. Sure, if you're not used to working with the command line, you might feel a bit daunted… don't. Mole is actually quite easy to use.

I want to show you how to install and use Mole.

Installing Homebrew

What you'll need: To install and use Mole, you'll need an up-to-date Mac. That's it. Let's get cleaning.

The first thing to do is click the Launch Pad icon on your dock, search for Terminal, and click to open the app.

Show more

To install Homebrew, issue the following command:

Show more

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

Note: Remove the spaces after the first two / characters.

Also: A MacOS 26 bug bricked my $3,700 Mac Studio - here's how I miraculously got it back

If you're running a Mac with Apple Silicon, you'll need to run the following:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

To run Homebrew, you'll need to add the installed command to your $PATH, which is done with the following command:

Show more

echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.bash_profile && source ~/.bash_profile

You're now ready to install Mole.

Installing Mole

Within the terminal app, install Mole with the command:

brew install mole

That should do the trick. You're now ready to use Mole.

Using Mole

To use mole, issue the command:

mole

When Mole opens, you'll see a text-based menu which lists:

  • Clean
  • Uninstall
  • Optimize
  • Analyze
  • Status

First, select 1 (Clean), and you'll then be prompted that the action requires sudo. Hit Enter on your keyboard, and you'll be prompted for your sudo password.

Also: I tested local AI on my M1 Mac, expecting magic - and got a reality check instead

Mole will begin a deep scan of your system. Depending on how much data you have in your system, this could take some time. Give Mole time to complete the process.

When the scan completes, Mole will report on how much it cleaned. In my case, Mole cleared up 19.85GB of space. Yeah, it's pretty effective.

You can also use Mole to optimize and analyze your system. The Mole optimizer does the following: rebuilds system databases, clears diagnostic logs, resets network services, cleans up swap files, and refreshes Spotlight indexing. Again, the optimization will take some time, so allow it to complete its task.

Also: M3 MacBook Air vs. M2 MacBook Air: Which Apple laptop should you buy?

After you done just these two things, you should find that your Mac runs better and has more free space. 

Mole should be considered a must for those who like to keep their Macs free of unnecessary files and optimized to run efficiently. 

Install this free app today.

Read Entire Article