How to prevent files from being deleted from the Mac desktop

If you share your Mac with kids, colleagues, or guests, you’ve probably felt that sinking feeling of finding an important file missing from your desktop. Whether it’s an accidental drag to the Trash or some overzealous “cleaning,” desktop files are especially vulnerable — they’re always visible and one click away from deletion. The good news: macOS gives you several ways to protect them, from quick file locks to fully separate user accounts.

Option 1: Give other people their own user account (best for regular sharing)

If someone else uses your Mac regularly, the most robust solution is to stop sharing your account entirely. Create a separate standard or guest account for them in System Settings > Users & Groups. Since macOS Big Sur, fast user switching makes hopping between accounts nearly instant, so there’s barely any inconvenience. Files on your desktop live inside your user folder, and another account simply can’t touch them — no accidental deletions, no snooping. This is also the only method that protects against deliberate deletion.

Option 2: Lock individual files and folders

For occasional access — say a colleague borrows your Mac for an hour — locking is quick and effective:

  1. In Finder, select the file or folder you want to protect.
  2. Press Cmd+I (or right-click and choose Get Info).
  3. In the Info window, check the “Locked” box.
  4. Close the window.

Locked items show a small lock badge on their icon, and if someone tries to delete one, Finder asks for confirmation first. That extra “are you sure?” step stops the vast majority of accidents. To unlock later, just uncheck the box again.

Mac Finder Get Info window with the Locked checkbox highlighted to protect a desktop file

Option 3: Lock files with Terminal

Prefer the command line, or want to lock many files at once? Terminal can do it:

  1. Open Terminal (from Applications > Utilities, or find it quickly with our guide on quickly opening your installed apps list on macOS).
  2. Type chflags uchg followed by a space, then drag the file from Finder into the Terminal window — macOS pastes the full path for you. Press Enter.
  3. To unlock later, repeat the same command with chflags nouchg instead.

This sets the same user-level lock as the Get Info checkbox, and it’s completely reversible. One warning: never use the system-level schg flag you might see mentioned in old forum posts — it can only be cleared in recovery mode and will cause real headaches.

Option 4: Change Sharing & Permissions to read-only

Another route through the same Get Info window: expand “Sharing & Permissions” at the bottom and set the other account’s privilege to “Read only.” They can open and view the file but can’t modify or delete it. This pairs nicely with a personalized desktop — see how to change folder colors and add emoji on macOS to make your protected folders visually obvious.

If it still doesn’t work

One important caveat: a locked file can still be deleted if someone deliberately holds the Option key while emptying the Trash — macOS treats that as an override. Locking protects against accidents, not against a determined person. If files keep disappearing despite locks, that’s your sign to move to separate user accounts. Macworld has covered Finder’s locking behavior in depth, and Apple Support documents how guest accounts and file permissions work on the Mac.

FAQ

Can I lock my entire desktop at once?

Yes — select everything on the desktop (Cmd+A with the Desktop selected in Finder), press Cmd+I, and check “Locked” in the summary Info window. Or run chflags uchg ~/Desktop/* in Terminal. Just remember you’ll need to unlock files before editing them yourself.

Will locking stop me from editing my own files?

A locked file can’t be modified until you unlock it, so there’s a small extra step when you want to make changes yourself. That’s the trade-off — and exactly why separate accounts are the better choice when someone else uses your Mac often.

Conclusion

For quick protection, lock important desktop files with Get Info or Terminal. For lasting peace of mind, give other users their own account. Either way, your desktop files stop vanishing — and you stop getting that sinking feeling.

shamsigai
We will be happy to hear your thoughts

Leave a reply

About CompareWala

CompareWala helps you compare prices, features, and reviews across top online stores — so you never overpay again. We track products on Amazon, AliExpress, and more, bringing every deal together in one place.

Get in Touch

Questions, suggestions, or partnership inquiries? We would love to hear from you.

Email: [email protected]

© 2026 CompareWala. All rights reserved. Prices shown are from third-party stores and may change.