How to Delete Files on Windows and Mac (Safely and Permanently)

March 1, 20265 min readBy FreeUpDisk Team

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

  1. Select the file or folder in File Explorer
  2. Press Delete (sends to Recycle Bin) or Shift + Delete (permanently deletes, skips Recycle Bin)
  3. To permanently remove files in the Recycle Bin: right-click the Recycle Bin → Empty Recycle Bin

Mac

  1. Select the file or folder in Finder
  2. Press Command + Delete (moves to Trash) or drag to the Trash icon in the Dock
  3. 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/Caches on 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_modules folders - delete freely, run npm install to restore anytime
  • dist, build, .next output folders - regenerated on every build
  • Docker images - run docker system prune to 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
  • .bak files - 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:

  1. Close the application using the file
  2. If you can't identify which app, restart your PC and try again
  3. 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 del command in an elevated Command Prompt

On Mac: "The item can't be moved to the Trash"

  1. Quit any app that might be using the file
  2. If still stuck: open Terminal and run sudo rm -rf /path/to/file (use with caution - there's no undo)
  3. 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:

  • ~/Library folder - 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, use DISM /Online /Cleanup-Image /StartComponentCleanup
  • Hibernation file (hiberfil.sys) - if you don't use Hibernate, disable it with powercfg -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

Get FreeUpDisk free →

See how FreeUpDisk works

Visual treemap, instant scan, safe cleanup, all for free.

Explore features

Ready to free up disk space?

Get FreeUpDisk and reclaim your storage in minutes.

Get started free