The basic way to delete a file depends on your operating system

On Windows, right-click the file and select Delete. It moves to the Recycle Bin. To remove it permanently, empty the Recycle Bin by right-clicking the desktop icon and selecting Empty Recycle Bin, or open File Explorer, locate the Recycle Bin folder, right-click it, and choose Empty Recycle Bin.

On Mac, drag the file to the Trash in your dock, or select it and press Command+Delete. To permanently remove it, right-click the Trash icon and select Empty Trash. Once emptied, the file cannot be recovered through normal means.

On Linux, the method varies by desktop environment. In most file managers (like Nautilus or Dolphin), right-click the file and select Move to Trash or Delete. To permanently remove it, empty the Trash folder. From the command line, use rm filename to delete immediately without sending to trash.

Key Takeaways

  • Deleting a file on Windows, Mac, or Linux first moves it to Trash or Recycle Bin, where it remains recoverable until you empty that folder.
  • Emptying Trash or Recycle Bin removes the file from view, but the data may still exist on your drive until the space is overwritten.
  • Secure deletion tools overwrite file data multiple times, making recovery much harder, and are worth using for sensitive documents.
  • External drives and cloud storage require separate deletion steps — removing a file from your computer does not remove it from backups or synced accounts.

What happens when you delete a file

When you delete a file through your operating system's normal method, the file does not vanish immediately. Instead, the system marks the space it occupied as available for new data. The file itself remains on your drive until another program writes over that space. This is why deleted files can often be recovered using data recovery software — the data is still there, just hidden from view.

Emptying Trash or Recycle Bin removes the file from your operating system's tracking, but again does not may provide the data is gone. The space is simply marked as free. On a busy drive that fills up quickly, new files will overwrite the old data. On a drive with plenty of free space, deleted files can sit there for months or years.

Secure deletion for sensitive files

If you need to ensure a file cannot be recovered, use a secure deletion tool. These programs overwrite the file's data multiple times with random information before removing it, making recovery far more difficult. On Windows, Eraser (free, open-source) and CCleaner (free version available) both offer secure deletion. On Mac, Permanent Eraser and Secure Empty Trash (built into some Mac models) do the same work. On Linux, the shred command overwrites files from the terminal.

Secure deletion takes longer than normal deletion because it writes to the drive multiple times. For everyday files, it is unnecessary. For documents containing passwords, financial records, medical information, or other sensitive data, it is worth the extra step. Keep in mind that secure deletion does not work reliably on solid-state drives (SSDs), where the drive's own firmware controls where data is written. For SSDs, full-drive encryption before storing sensitive files is a better approach.

Deleting files from external drives and cloud storage

Removing a file from your computer does not remove it from external hard drives, USB drives, or cloud storage accounts. You must delete it from each location separately. Connect the external drive, locate the file, and delete it using the same method as your main drive. For cloud storage like Google Drive, OneDrive, or Dropbox, sign in to your account online or through the desktop app, find the file, and delete it there. Some cloud services move deleted files to a trash folder first; you may need to empty that as well.

If you have automatic backups running (through Time Machine on Mac, File History on Windows, or a third-party backup service), deleting a file from your main drive does not remove it from backups. Check your backup software's settings to understand how long it keeps deleted files. Some services retain deleted files for 30 days; others keep them indefinitely. If you need to remove a file from backups as well, you may need to access the backup software directly or contact your backup provider.

Deleting files you cannot access or that are in use

Sometimes a file will not delete because another program is using it. Close the program first, then try deleting again. If you are unsure which program has the file open, restart your computer — this closes all running programs and usually frees up the file.

On Windows, if a file still will not delete after restart, try Safe Mode. Restart your computer and hold F8 during startup (timing varies by Windows version; check your system's documentation). In Safe Mode, fewer programs run, so the file is more likely to be free. Delete it, then restart normally. If the file is a system file you do not recognize, do not delete it — you may damage your operating system.

On Mac, if a file will not delete, check its permissions. Right-click the file, select Get Info, and look at the Sharing & Permissions section at the bottom. Make sure your user account has Read & Write access. If it does not, click the lock icon, enter your password, and change the permission. Then try deleting again.

Recovering accidentally deleted files

If you delete a file by mistake and realize it immediately, stop using your computer. Every time you save a new file, write an email, or download something, you risk overwriting the deleted file's data. The sooner you stop, the better your chances of recovery.

Use data recovery software to scan your drive. On Windows, Recuva (free) and EaseUS Data Recovery Wizard (free version available) are common choices. On Mac, Data Rescue and DiskWarrior work similarly. These programs scan your drive for traces of deleted files and attempt to reconstruct them. Recovery is not may provide — if the space has been overwritten, the file is gone. But if you act quickly, recovery is often possible.

Bulk deletion and folder removal

To delete multiple files at once, select them all using Ctrl+A (Windows and Linux) or Command+A (Mac) to select everything in a folder, or click the first file, hold Shift, and click the last file to select a range. Then press Delete or right-click and choose Delete. All selected files move to Trash or Recycle Bin together.

To delete an entire folder and everything inside it, right-click the folder and select Delete. The folder and all its contents move to Trash or Recycle Bin. Be certain before doing this — deleting a folder is faster than deleting files one by one, but it is also easier to delete something you meant to keep. If you are unsure, move the folder to a temporary location first, wait a few days to confirm you do not need it, then delete it.

Frequently Asked Questions

Can I recover a file after I empty the Recycle Bin or Trash?

Yes, but only if the space has not been overwritten. Use data recovery software like Recuva (Windows) or Data Rescue (Mac) to scan your drive. The sooner you try, the better your chances. If you have been using your computer normally since the deletion, the file may already be overwritten and unrecoverable.

What is the difference between moving a file to Trash and permanently deleting it?

Moving to Trash keeps the file on your drive in a separate folder, where you can still see it and restore it. Permanently deleting (by emptying Trash) removes it from view and marks the space as available for new data, though the data itself may remain until overwritten. Secure deletion tools go further by overwriting the data multiple times.

Do I need to use secure deletion for every file I delete?

No. Secure deletion is slower and unnecessary for everyday files like photos, documents, or downloads. Use it only for sensitive information like passwords, financial records, or medical data. For most users, normal deletion followed by emptying Trash is sufficient.

If I delete a file from my computer, does it get deleted from my cloud storage?

Not automatically. Files on cloud services like Google Drive or OneDrive are separate from files on your computer, even if they are synced. You must delete the file from the cloud service separately by signing in online or through the app and removing it there.

Why can't I delete a file that says it's in use?

A file in use is open in another program. Close that program first, then try deleting again. If you are unsure which program has it open, restart your computer. After restart, try deleting once more. If it still will not delete, the file may have special permissions or be a system file — check your user account's access level before trying again.