Delete Temporary Files and Folders: A Step-by-Step Guide for macOS and Windows
Temporary files and folders accumulate over time from app installs, web browsing, system updates, and background processes. Removing them safely frees disk space, improves performance, and can resolve certain errors. This guide gives clear, step-by-step instructions for macOS and Windows, plus tips on what to delete and when to back up.
Important preliminary notes
- Backup first if you have critical unsaved work or custom app settings. Deleting caches can remove locally stored data (e.g., saved web sessions).
- Close running applications before deleting temp files to avoid removing files currently in use.
- Follow the platform-specific steps below — do not mix commands from both OSes.
macOS
1) Use built-in Storage Management
- Click the Apple menu → About This Mac → Storage → Manage.
- Review recommendations: Store in iCloud, Optimize Storage, Empty Trash Automatically, and Reduce Clutter.
- Click Review Files under Reduce Clutter to find large or old files to remove.
2) Clear user cache and temporary folders (safe routine)
- Open Finder → Go → Go to Folder…
- Enter: ~/Library/Caches and press Enter.
- In the Caches folder, select folders for apps you recognize (e.g., com.apple.Safari, com.google.Chrome) and move them to Trash.
- Repeat for /Library/Caches (system-wide) by going to /Library/Caches — be conservative here: only remove obvious app or installer caches.
- Empty Trash and restart.
3) Clear temporary files created by system and apps
- Go to Finder → Go to Folder… and enter: /private/var/folders
- Inspect subfolders for obvious temporary caches (folders can be cryptic). Delete only older-looking folders or ones clearly labeled tmp or cache.
- Empty Trash and restart.
4) Clear browser caches (examples)
- Safari: Safari → Settings → Advanced → Show Develop menu in menu bar. Develop → Empty Caches.
- Chrome: Chrome menu → More Tools → Clear Browsing Data → select Cached images and files → Clear data.
5) Use a trusted cleanup app (optional)
- Consider third-party apps like OnyX or CleanMyMac X (pay attention to permissions and reviews). Use them only if you trust the developer and have a backup.
Windows (Windows 10 / 11)
1) Use Settings Storage tools
- Settings → System → Storage.
- Turn on Storage Sense to automate removing temporary files and emptying Recycle Bin.
- Click Temporary files to see categories (Temporary files, Downloads, Previous Windows installations, Delivery Optimization files).
- Select the categories to delete and click Remove files.
2) Use Disk Cleanup (classic)
- Open Start, type Disk Cleanup, and run it.
- Choose the drive (usually C:) and let it calculate.
- Check items like Temporary files, Recycle Bin, and Temporary Internet Files; click OK and then Delete Files.
- Optional: click Clean up system files to remove Windows Update leftovers and previous installations.
3) Manually clear the temp folder
- Press Windows+R, type %temp%, press Enter — this opens your user Temp folder.
- Select all (Ctrl+A) and delete. Skip files currently in use.
- Repeat with: C:\Windows\Temp (you’ll need admin rights).
4) Clear browser caches
- Edge/Chrome: Settings → Privacy, search, and services → Clear browsing data → choose Cached images and files → Clear now.
- Firefox: Options → Privacy & Security → Cookies and Site Data → Clear Data.
5) Use PowerShell for advanced cleanup (example)
Run PowerShell as Administrator and execute:
Code
Get-ChildItem -Path $env:TEMP -Recurse -Force | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue
Use with caution — this force-removes temp files in the user temp directory.
What not to delete
- System files outside cache/temp folders unless you are certain.
- Files in Downloads unless you know what they are.
- Anything marked read-only or currently in use.
- Profiles, settings, or documents needed by applications you use.
When to delete temp files
- When disk space is low.
- After uninstalling large applications.
- If apps are behaving oddly or crashes correlate with large caches.
- Periodically (monthly or quarterly) as maintenance.
Troubleshooting
- If an app misbehaves after cache removal, restart the app or the system; some caches will be rebuilt.
- If Windows Update fails after cleaning system files, restore from a System Restore point or reinstall pending updates.
- If you accidentally remove needed data, restore from backup or use file-recovery tools promptly.
Quick checklist (one-minute)
- macOS: Empty Trash, clear ~/Library/Caches, restart.
- Windows: Run Storage Sense or Disk Cleanup, clear %temp%, restart.
- Clear browser caches separately.
Leave a Reply