Skip to content

Instantly share code, notes, and snippets.

@Orismann
Last active June 7, 2024 03:10
Show Gist options
  • Save Orismann/7d9ba47020d08525577ee0755c2816d3 to your computer and use it in GitHub Desktop.
Save Orismann/7d9ba47020d08525577ee0755c2816d3 to your computer and use it in GitHub Desktop.

Our lives are increasingly intertwined with technology, the storage space on our devices becomes a valuable commodity. Mac users often find themselves grappling with the perennial issue of managing storage space efficiently. Accumulated files, applications, and system clutter can clog up your Mac's storage, slowing down performance and hindering productivity.

In this guide, we'll use the built-in Terminal app to free up space on your Mac without using any third-party software.

1. Empty the Trash

Start by emptying the Trash. Even though this can be done through the Finder, you can also do it via Terminal using the rm command.

sudo rm -rf ~/.Trash/*

2. Remove System and User Cache Files

Clear system and user cache files, which can sometimes take up significant space.

sudo rm -rf /Library/Caches/*

rm -rf ~/Library/Caches/*/

3. Remove System and User Log Files

Log files can accumulate over time and consume a considerable amount of disk space, especially on systems with limited storage. Removing unnecessary log files can help free up space for other purposes, such as installing new applications or storing personal files.

sudo rm -rf /Library/Logs/* rm -rf ~/Library/Logs/*

Alternative Suggestion: Automatically Clean Massive Space with GUI App (More Safe and Save Time)

Not all people are willing to play with text command and sometimes it is more dangrous as the wrong input would bring severe issue to the underlaying operating system. It is more recommended for advanced users. If you want to try a safe and easy way to free space on a Mac, then go with a Mac cleaner app instead.

They will automatically locate all the junk and cache files on your Mac and you can delete GBs of free space in one click. The below screenshot is showing 28GB free space to be cleaned up with the help of CleanGeeker app, including application junk files, leftover files, system cache files, log files. This is much more user friendly approach to get more free space on your Mac.

CleanGeeker Download: https://www.tunesbro.com/downloads/CleanGeeker.dmg

CleanGeeker

@IamCoderman100
Copy link

I must say, not everyone is comfortable tinkering with text commands in Terminal. It's true, using command-line tools can be a bit daunting for those not accustomed to it, and there's always a risk of entering a command incorrectly, which could potentially cause problems with your operating system.

For CleanGeeker you mentioned, I used it on my MacBook macOS Ventura, that's good! I was able to clear up an astonishing 28GB of space with one click! I think the tool with a graphical interface like this is more suitable for those who are not tech-savvy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment