ThisCalculator

Everyday

Free Up Disk Space Safely on Windows, macOS, Ubuntu

Updated · Standard formula, shown below

Free Up Disk Space Safely on Windows, macOS, Ubuntu

Running low on disk space slows down your system and can cause errors. This guide shows you safe, effective ways to reclaim space on Windows, macOS, and Ubuntu without deleting important files. You’ll learn built-in tools, common caches, and what to avoid.

What You’ll Need

  • Administrator or sudo access (for system-level cleanup)
  • About 30 minutes of time
  • For macOS: a current Time Machine backup (recommended before deleting anything)
  • For Ubuntu: a terminal window (Ctrl+Alt+T)

Step-by-Step

Windows

  1. Use Storage Sense (Windows 10/11): Go to Settings > System > Storage. Turn on Storage Sense to automatically delete temporary files and empty the Recycle Bin periodically. Click “Configure Storage Sense or run it now” to run it immediately.
  2. Run Disk Cleanup: Type “Disk Cleanup” in the Start menu and open it. Select your system drive (usually C:). Click “Clean up system files” to include Windows Update leftovers, old driver versions, and system error memory dumps. Check all categories and click OK.
  3. Uninstall unused apps: Go to Settings > Apps > Installed apps. Sort by size and remove anything you no longer use. Pay special attention to large games, video editors, and trial software.
  4. Move personal files to another drive: If you have a second drive or cloud storage, move large folders (Videos, Downloads, Documents) there. Right-click the folder, choose Properties > Location, and change the path.
  5. Disable Hibernation (if you never use it): Open Command Prompt as administrator (right-click Start > Windows Terminal (Admin)). Type powercfg /h off and press Enter. This removes the hiberfil.sys file, which can be several GB. (Your PC will lose the ability to hibernate; sleep still works.)

macOS

  1. Check storage usage: Click the Apple menu > About This Mac > Storage. This shows a color-coded breakdown of your disk. Click “Manage” for recommendations.
  2. Use Optimize Storage: In the Storage management window, enable “Optimize Storage” to automatically remove watched Apple TV movies and TV shows, and “Empty Trash Automatically” to delete items older than 30 days.
  3. Clear system caches (safe method): Open Finder, press Cmd+Shift+G, and type ~/Library/Caches. Look inside folders for large files (sort by size in List view). Delete only the contents of folders you recognize (e.g., browser caches, app caches). Do not delete the folders themselves. Empty the Trash afterward.
  4. Remove language files (optional): Some apps bundle many languages. Use a utility like Monolingual (free) or manually delete unused language files inside app bundles, but this is advanced—skip if unsure.
  5. Delete Time Machine local snapshots: If you use Time Machine, local snapshots can accumulate. Go to Time Machine settings and disable “Back Up Automatically” temporarily, or run tmutil listlocalsnapshots / in Terminal and delete each with tmutil deletelocalsnapshots.

Ubuntu

  1. Clean apt package cache: Open a terminal and run sudo apt clean to remove downloaded .deb files from /var/cache/apt/archives. Then run sudo apt autoremove to remove unused dependencies (old kernels, orphaned packages).
  2. Remove old kernels: Ubuntu keeps multiple kernel versions. Run dpkg --list | grep linux-image to see them. Keep the current one (check with uname -r) and one previous. Remove others with sudo apt purge linux-image-<version>.
  3. Clean journal logs: System logs can grow. Run sudo journalctl --vacuum-size=100M to keep only the last 100 MB of logs. To set a permanent limit, edit /etc/systemd/journald.conf and set SystemMaxUse=100M.
  4. Use a GUI cleanup tool: Install and run sudo apt install bleachbit (or use Ubuntu Cleaner from the Software Center). These tools scan for browser caches, temporary files, and old logs. Review the checkboxes carefully before cleaning.
  5. Remove orphaned packages: Run sudo apt install deborphan and then deborphan to list orphaned libraries. Remove them with sudo apt autoremove (this is usually already done).

Common Mistakes

  • Deleting system files blindly: On Windows, never delete files from C:\Windows\System32 or C:\Program Files. On macOS, don’t remove anything from /System or /Library. On Ubuntu, avoid /usr and /etc unless you know exactly what you’re doing.
  • Clearing all caches: Some caches speed up apps. Clearing all of them can make apps slower initially but will rebuild. Only clear caches for apps you don’t use often.
  • Ignoring the Recycle Bin/Trash: Files you delete still take up space until you empty the Trash. Always empty it after a big deletion.
  • Using “disk cleanup” tools that promise too much: Many third-party “optimizers” are unnecessary and may remove files you need. Stick to built-in tools.
  • Forgetting to restart: Some files are locked while the OS is running. Restart before and after cleanup to free up handles.

Tips

  • Use a disk space analyzer: Tools like WinDirStat (Windows), DaisyDisk (macOS), or Baobab (Ubuntu) visually show what’s taking space. They help you spot large files quickly.
  • Move media to cloud or external drive: Photos, videos, and music are often the biggest space hogs. Use cloud storage (Google Photos, iCloud, OneDrive) or an external HDD.
  • Compress old files: If you have large folders you rarely access, compress them into a .zip or .7z file. This can save up to 70% on text files.
  • Keep your system updated: Updates often include cleanups and bug fixes that prevent bloat.
  • Set a regular schedule: Do a quick cleanup monthly. Set a reminder on your phone or use Task Scheduler (Windows) or cron (macOS/Ubuntu) to automate some steps.

Troubleshooting

  • Disk still full after cleanup: Run a disk space analyzer to find hidden large files. Check for hibernation files (Windows), Time Machine local snapshots (macOS), and Docker images (Ubuntu).
  • Cannot delete a file (permission denied): Make sure you have administrator rights. On Windows, take ownership of the file (right-click > Properties > Security > Advanced). On macOS, use Finder > Get Info > Sharing & Permissions. On Ubuntu, use sudo rm but be careful.
  • System becomes unstable after cleanup: This is rare but can happen if you deleted a required system file. Restore from backup (Time Machine, System Restore, or a system image). If you didn’t have a backup, you may need to reinstall the OS.
  • Ubuntu: apt autoremove removes something you need: Usually it’s safe, but if an app stops working, reinstall it with sudo apt install <package>. Check the list before confirming.
  • macOS: “Other” storage is huge: This includes caches, logs, and Time Machine snapshots. Use the steps above, and also check ~/Library/Application Support for app data you don’t need.

Frequently Asked Questions

Is it safe to delete the “Windows.old” folder?

Yes, after a major Windows update, the old system files are stored in Windows.old. You can delete it via Disk Cleanup (select “Previous Windows installation(s)”). You cannot roll back the update afterward.

How do I clear the DNS cache on macOS?

That doesn’t free up meaningful disk space. For disk space, focus on caches in ~/Library/Caches. DNS cache is memory, not disk.

What is the largest space consumer on Ubuntu?

Usually the /var directory (logs, apt cache) and /home (user files). Use du -sh /* to see sizes, then drill down.

Can I delete the “Library” folder on macOS?

No. The Library folder contains system and app support files. Deleting it will break your system. Only delete specific subfolders like Caches or Logs.

Why does my disk fill up again quickly?

Automatic downloads, app caches, and system logs grow over time. Check your Downloads folder, clear browser caches, and review startup apps that might be downloading updates.

Is it safe to use third-party cleanup tools?

Many are safe, but some are aggressive. Stick to reputable ones (e.g., CCleaner for Windows, CleanMyMac X for macOS, BleachBit for Ubuntu) and always review what they will delete. Built-in tools are usually enough.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.