Reclaim disk space and scan your Mac for viruses
Learn how to free up storage and check your Mac for malicious software with a single command. Apple recommends running this maintenance script at least once a month to keep your Mac fast, clean, and secure. The script recovers disk space, removes system caches, and scans your system for viruses and other threats — all at once.
Step 1: Launch Terminal
Step 2: Execute the Cleanup & Scan Script
Loading...
How this script works:
Why your Mac needs regular maintenance
Over time, macOS accumulates a significant amount of temporary data — browser caches, system logs, partially downloaded updates, and leftover files from uninstalled applications. These files are not visible in Finder by default, yet they can occupy tens of gigabytes of disk space. On top of that, unwanted software — adware, browser hijackers, or trojanized installers picked up from the web — can quietly settle into system folders, slow your Mac down, and consume additional resources in the background. When left unchecked, your Mac may slow down, refuse to install updates, or display the “Your disk is almost full” warning.
What gets removed
What the virus scan detects
Is it safe?
Yes. The cleanup portion only targets files that macOS marks as expendable — temporary caches, logs, and system-generated data. The virus scan is read-only: it inspects file signatures and system behavior without altering critical components. Your personal files, photos, documents, and application settings remain completely untouched. Anything the scan flags as malicious is moved to an isolated quarantine folder so you can review it before permanent removal. macOS will automatically regenerate any system caches it needs, so there is no risk of data loss or system instability.
How much space can I expect to recover?
The amount of recovered storage varies depending on how long it has been since your last cleanup and how many applications you use regularly. On average, users recover between 5 GB and 25 GB of disk space. In some cases — particularly on systems that have not been cleaned in over a year — the script can free up 40 GB or more.
Tips to keep your Mac healthy and secure
Published Date: May 8, 2025