How to Delete Files on Windows and Mac (Safely and Permanently)
Deleting files seems simple - but there are a few ways it goes wrong: files that won't delete, deleted files that still take up space, and not knowing which files are safe to remove in the first place. This guide covers all of it.
The basics: how to delete files
Windows
- Select the file or folder in File Explorer
- Press Delete (sends to Recycle Bin) or Shift + Delete (permanently deletes, skips Recycle Bin)
- To permanently remove files in the Recycle Bin: right-click the Recycle Bin → Empty Recycle Bin
Mac
- Select the file or folder in Finder
- Press Command + Delete (moves to Trash) or drag to the Trash icon in the Dock
- To permanently remove files in the Trash: right-click the Trash → Empty Trash, or Command + Shift + Delete
Important: Until you empty the Recycle Bin / Trash, deleted files are still taking up space on your drive. This is a common source of confusion - "I deleted it but my disk is still full."
How to find files worth deleting
Random deletion rarely frees much space. The most effective approach is to scan your drive first and target the largest files.
FreeUpDisk is a free disk analyzer for Windows and Mac. It scans your entire drive in under 30 seconds and shows a treemap where every file is a rectangle - bigger rectangles mean bigger files. You can see at a glance which files and folders are taking the most space, click into any area to explore, and then delete from there.
Without a tool like this, you're guessing. With it, you see the answer immediately.
What's safe to delete
Always safe
- Downloads folder - old installers, zip files, disk images (
.dmg,.iso,.exe) you've already used - Temporary files - press Win + R →
%temp%on Windows;~/Library/Cacheson Mac - Duplicate files - same content in multiple locations
- App cache folders - Chrome, Slack, Dropbox caches are safe to clear; the app rebuilds them
Safe for developers
node_modulesfolders - delete freely, runnpm installto restore anytimedist,build,.nextoutput folders - regenerated on every build- Docker images - run
docker system pruneto remove unused ones - Xcode DerivedData (
~/Library/Developer/Xcode/DerivedData) - safe to delete
Be careful
- System folders (
C:\Windows,/System,/Library) - don't delete files from here manually - Application Support folders - contains app data, not the same as caches
- Files you don't recognize - research before deleting; they might be dependencies or config files
.bakfiles - might be database backups you still need
How to delete files that won't delete
On Windows: "File is in use"
A file locked by a running process can't be deleted. Try:
- Close the application using the file
- If you can't identify which app, restart your PC and try again
- For persistent cases: open Task Manager (Ctrl + Shift + Esc), look for processes using the file, and end them
For system-protected files, you may need to:
- Run File Explorer as Administrator
- Use the
delcommand in an elevated Command Prompt
On Mac: "The item can't be moved to the Trash"
- Quit any app that might be using the file
- If still stuck: open Terminal and run
sudo rm -rf /path/to/file(use with caution - there's no undo) - For files locked by macOS: right-click → Get Info → uncheck "Locked"
How to permanently delete files (so they can't be recovered)
Standard deletion doesn't overwrite the data - it just marks the space as available. The file content remains until new data is written over it, which means recovery software can often get it back.
For truly permanent deletion:
Windows: Use the cipher /w:C:\ command (Admin Command Prompt) to overwrite free space, or use a tool like Eraser.
Mac: Starting with macOS Monterey, Secure Empty Trash is no longer available for SSDs (because SSDs handle data differently). For an SSD, standard deletion is sufficient - the drive's wear-leveling eventually overwrites the data. For HDDs: use Disk Utility → Erase with a secure option.
For sensitive data, the most reliable option is full-disk encryption (FileVault on Mac, BitLocker on Windows) combined with standard deletion.
How to delete large hidden files you can't see
Some of the biggest space users on your machine aren't visible in normal Finder or File Explorer views:
On Mac:
~/Libraryfolder - hidden by default; open with Finder → Go → Go to Folder →~/Library- Time Machine local snapshots - use
tmutil deletelocalsnapshots /in Terminal to remove them - iOS backups - stored in
~/Library/Application Support/MobileSync/Backup
On Windows:
- WinSxS (
C:\Windows\WinSxS) - Windows component store; don't delete manually, useDISM /Online /Cleanup-Image /StartComponentCleanup - Hibernation file (
hiberfil.sys) - if you don't use Hibernate, disable it withpowercfg -h off(Admin Command Prompt) - System Restore points - manage through Control Panel → System → System Protection
The fastest way to find all these hidden large files is a disk analyzer. FreeUpDisk shows you everything on your drive - including folders that are hidden from normal view - so you can make informed decisions about what to delete.
Summary
| Task | Windows | Mac |
|---|---|---|
| Delete file | Delete key → empty Recycle Bin | Cmd+Delete → empty Trash |
| Permanently delete | Shift+Delete | Cmd+Shift+Delete |
| Delete temp files | Win+R → %temp% |
~/Library/Caches |
| File won't delete | Restart, or close locking app | Quit app, or sudo rm in Terminal |
| Find large files | FreeUpDisk treemap | FreeUpDisk treemap |
See how FreeUpDisk works
Visual treemap, instant scan, safe cleanup, all for free.
Related guides
What's Taking Up Space on My Hard Drive? (Windows 11 & Mac Guide)
Drive full but nothing looks big? Here's how to find what's secretly taking up space on Windows 11 and Mac — and free it up in minutes.
ReadHow to Free Up Disk Space (Windows & Mac Guide for 2026)
Disk full? This guide shows you exactly how to free up disk space on Windows and Mac - quickly and safely, without deleting things you need.
ReadHow to Free Up 150 GB of Disk Space in 15 Minutes
Your hard drive is full and your computer is crawling. Here's how to reclaim up to 150 GB of wasted space in just 15 minutes using FreeUpDisk's visual treemap analyzer.
Read