logo
MC Software Lab
Contact Me

How to Save Space on macOS: Easy zip, tar.xz, and Terminal Tips

How to Save Space on macOS: Easy zip, tar.xz, and Terminal Tips
Manuel CrispinoManuel Crispino2025-09-25

Introduction

If your Mac is running low on storage, it can slow down performance and make everyday tasks frustrating.

Luckily, there are simple ways to free up space and keep your Mac organized.

In this guide, you’ll learn how to compress files using zip and tar.xz, check how much space your folders are using, and use a few basic Terminal commands to manage your files efficiently.

Whether you’re a casual user or someone who loves digging into your Mac, these tips will help you save space and keep your system running smoothly.


1. Enter into your Terminal

The Terminal is the fastest and most powerful way to interact with your Mac.

Using it, you can navigate folders, check disk usage, and manage files like a pro—without relying on menus or Finder.

Don’t worry if you’re new to it; we’ll go through the essential commands step by step.


To open Terminal

  • press ⌘ Command + Space to open Spotlight
  • type Terminal, and hit Enter.

2. Basic Terminal Commands

Now that you’ve opened your Terminal, let’s get familiar with some essential commands that will help you navigate your Mac and manage files efficiently.


Navigation commands

# Shows your current directory (where you are in the file system)
pwd

# Lists all files and folders in the current directory
ls

# Lists files with readable sizes (KB, MB, etc.) and additional details
ls -lh

# Move into a folder
cd folder_name

# Go back one directory
cd ..

# Go to your home directory
cd ~

# Stay in the current directory (useful with scripts)
cd .

Video Introduction

If you’re not familiar with the Terminal, you can watch this introduction video.

It covers the basics of commands, folder hierarchy, and handy shortcuts like:

  • Tab completion
  • cd ~
  • cd /

3. Check the storage

Now that we’ve covered some basic commands, we can dive into the core of this article: memory management on your Mac.

Using these commands in the Terminal makes managing storage much easier than going through files one by one.


Useful tips:

you’ll save more space if you compress an entire folder that contains many files instead of compressing files one by one.


The tar.xz format

Achieves slightly better compression, but it takes more time and its syntax is a little harder to remember.


Zip files

On the other hand, zip files are much faster to create, though they usually save a bit less space.

From my personal experience, if your goal is to save the maximum amount of space, tar.xz is the better option.

It might feel difficult at first, but in the long run it can free up a significant amount of storage.


4. Useful Commands to Check Storage

Before compressing files, it’s important to know which folders are taking up the most space.

These commands will help you quickly check disk usage.

# Show how much space a folder uses replace folder_name with the name of your folder 
du -sh folder_name

# Show disk usage for all folders in the current directory
du -sh *

# Check overall free space on your Mac
df -h

5. Compress Files with zip

The zip command is built into macOS and is perfect for quickly compressing files and folders.

When using this command, replace myarchive.zip with the name you want for your new .zip file—make sure to include the .zip extension.

Instead of myfile.txt, type the name of the file you want to compress.

When compressing a folder, make sure to add the -r option, which recursively includes all files and subfolders, and the -q option to suppress output for a cleaner process.

Replace myfolder with the name of your folder. when it comes to folder make sure you add the -r option wich will recursevly put all the folders inside same thing myfolder replace with the name of your folder

# Compress a single file
zip myarchive.zip myfile.txt

# Compress a folder
zip -r myarchive.zip myfolder

# Compress a folder with -q option to silent the output
zip -r -q myarchive.zip myfolder

# Extract a zip archive
unzip myarchive.zip

6. Compress Files with tar.xz

If you want to maximize space savings, the tar.xz format usually provides better compression than zip.

It’s slightly slower and the syntax is a bit harder to remember, but it’s worth it if you want smaller archives.

# Create a compressed archive
tar -cJf myarchive.tar.xz myfolder

# Extract a tar.xz archive
tar -xJf myarchive.tar.xz

Video Example

Here you can watch a video demonstration of everything we’ve covered so far.

It shows how to use Terminal commands, compress files with zip and tar.xz, and check storage on your Mac.


Conclusion

Managing storage on your Mac doesn’t have to be complicated.

By using Terminal commands like du, df, zip, and tar.xz, you can quickly check which folders are taking up space and compress files or entire directories to free up valuable storage.

For beginners, starting with zip is fast and easy, while tar.xz offers better compression if you want to save the maximum amount of space.

Combining these tools with the tips provided in this guide will help you keep your Mac organized, optimized, and running smoothly.

With just a few commands and a little practice, you can take full control of your Mac’s storage and make room for the files that really matter.

👉 If this guide helped you, share it so it can help others too!

Get in touch


© 2025 Manuel Crispino