• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

AppleToolBox

Tools and Fixes for Mac, iPad, iPhone & iWatch

Search posts

  • About
  • Contact

CONNECT WITH US

CATEGORIES

  • iPhone
  • iPad
  • iPod
  • Apple Watch
  • Mac/MacBook
  • AirPods
  • Apple TV
  • News
  • Apple Services
  • HomePod
  • Reviews

SITE

  • Home
  • About Us
  • Contact
  • Advertise

Search posts

You are here: Home / Mac / Can’t delete a file on macOS because it’s ‘In Use’? Try this!

Can’t delete a file on macOS because it’s ‘In Use’? Try this!

By Mike Peterson 2 comments Last updated April 4, 2019

Normally, deleting a file on macOS is a simple affair. You drag it to the Trash or right-click and Move to Trash. Of course, sometimes things can go awry. For example, you may run into an error message that this “The operation can’t be completed because the item (name) is in use.” You can run into this error when sending a file to the Trash, or when attempting to Empty the Trash.

In the latter case, macOS does allow users to delete everything in the Trash beside that file. But that still leaves you with the annoying item sitting in the bin.

If you’ve been hit with that error message, here are a couple of things you can try to get rid of that pesky and stubborn file.

Related:

  • MacBook troubleshooting primer
  • Mac shows white screen on startup, how to fix
  • Could not assign applications error message on MacBook
  • How to Open and Extract RAR Files on macOS or Mac OSX

Contents

  • How to delete a file on macOS that’s “in use”
    • Using the Terminal to locate the “in-use” app and the corresponding file
    • Delete Immediately feature on MacBook
    • Nothing worked. What now?
  • Locked files & insufficient privileges

How to delete a file on macOS that’s “in use”

macOS File in Use
MacBook error message showing the file on mac OS that’s “in use.”

Before you do anything else, you should try a couple of things. These are, by far, the easiest fixes for the problem.

  • Quit the apps that you think may be using the troublesome file. If you don’t know which app might be using it, you may want to quit all apps.
  • If that doesn’t work, you’ll want to simply restart your Mac. After it’s booted back up, try deleting the file.
  • Restarting a Mac should work, but if it doesn’t, there’s likely a startup or login item that is using the file. From here, you’ll want to restart your Mac in Safe Mode and try deleting it. Safe Mode will stop any startup items from running.

In addition, here are a couple more in-depth methods for identifying and dealing with stubborn files from the Trash (or those that won’t move to the trash).

Using the Terminal to locate the “in-use” app and the corresponding file

macOS File in Use - Terminal
Use Terminal to locate the app that is using the file.

If you’re comfortable using the macOS Terminal, there is a command you can try that will identify which app is using the specific file.

  • Double-click on the Trash and make sure that a Finder window pops up.
  • Open the macOS Terminal, either by using Spotlight search or by going to Applications —> Terminal.
  • In the next step, you’ll want to type a simple command into the terminal — but don’t hit return just yet!
  • Type this command, followed by a space: lsof
  • Then, drag the annoying file from the Trash directly onto the Terminal window.
  • Once some text pops up, hit Return.
  • You should now see a list of the apps that processes that are actively using the file (and keeping it from being deleted).

From here, you can simply pinpoint and close the app that’s currently using the file.

If the file is being used by a background process, open Activity Monitor. Find the process in the list and click the X icon to terminate it.

Delete Immediately feature on MacBook

macOS File in Use - Delete Immediately
Use delete immediately feature on macOS to get rid of a file on macOS because it’s ‘In Use’.

In OS X El Capitan and later, Apple has also Delete Immediately. It’s a scorched-earth solution and there’s no going back, but it could come in handy for those extremely stubborn files in your Trash.

Delete Immediately is only accessible within the Trash app. So open it and select the files you’d like to delete. Control-click those files and select Delete Immediately. Confirm and those files should be gone.

Nothing worked. What now?

There may be those rare occasions in which the above steps simply don’t work. If that’s the case for you, there may be an underlying issue on your disk.

In these worst-case scenarios, Apple itself recommends booting up your Mac in macOS Recovery mode and using Disk Utility to repair the troublesome drive.

If you suspect there’s a deeper problem with your Mac causing file-trash stubbornness, we recommend taking it to your local Genius Bar or an Apple Authorized Service Provider.

Locked files & insufficient privileges

In addition to files being used by apps or processes, there are a couple of other things that could prevent you from deleting a file. Here’s a quick overview.

  • If the file is locked, then you’re going to run into trouble deleting it. You can unlock the file by right-clicking it and selecting Get Info. Open the General tab and deselect the Locked checkbox.
  • Sometimes, you may not have sufficient privileges to delete a file. In most cases, this is a good thing. You can always get an Administrator to delete the file, or give yourself Read & Write permissions in Sharing & Permissions.

We hope that you were able to use the tips in this article to locate the offending file and were able to tackle it. Please let us know if you have any questions using the comments below.

Related Posts:

  • pexels-designecologist-1779487
    The Best iPhone And Mac Shortcuts For Beginners
  • 2023 Mac Studio lifestyle - 1
    macOS Could Not Be Installed, How-To Fix
  • Photo of person sleeping after saving so much time with the best Automator routines for Mac
    The Best Automator Routines For Mac
  • Photo of someone using Apple Music on their smartphone
    How to Fix Apple Music Not Working on iPhone / iPad
  • Screen Shot 2021-08-12 at 7.36.51 PM
    The Best AirPods Max Cases For 2021
  • 2022 Mac Mini with Studio Display and Accessories
    Mac Tips For New Users In 2023
  • pexels-tima-miroshnichenko-6860464
    How To Start Using Regex With The Shortcuts App
  • pexels-tranmautritam-696899
    iPhone Tips for New Users In 2023
  • pexels-cottonbro-5082579
    Getting Started With iOS 15: Everything Good And Bad
mike - apple
Mike Peterson

Mike is a freelance journalist from San Diego, California.

While he primarily covers Apple and consumer technology, he has past experience writing about public safety, local government, and education for a variety of publications.

He’s worn quite a few hats in the journalism field, including writer, editor, and news designer.

Reader Interactions

Write a Comment Cancel reply

Show 2 Comments

  1. Roman Gaufman says

    June 24, 2023 at 6:18 AM

    None of these solutions helped. On Apple Silicon they added more security, even after booting into recovery mode and mounting the drive with Disk Utility, it is still impossible to delete ~/.Trash for some reason (other files can be deleted though).

    The only solution I could find was to run csrutil disable in the terminal, rebooting, deleting the relevant files and then re-enabling csr back in recovery mode.

    The reason I had to do this was for some reason I stopped being able to empty my trash, saying the file is “In Use” (even in safe mode).

    Reply
  2. Ramses Danta says

    August 11, 2021 at 6:01 AM

    in my case the app using the stubborn file is the Finder app itself, so it is impossible to turn it off — using several variations of delete directory in the terminal have also failed — I am about to pull all of my hair off 🙂 please help

    Reply

Primary Sidebar

Recent Posts

  • What to Do When Windows 11 Won’t Detect Your iPad
  • Outlook Outage 2026: iPhone Fixes for Sign-In Chaos
  • Guide to Changing iMessage Backgrounds on iPhone and Mac
  • Has Apple Killed Vision Pro? (Insane Sales Flop Explained)
  • 5 Great Apps for Staying Organized on Your iPhone
  • What Are iPhone Antennas and Do You Need One?

Connect with us

Footer

ABOUT

  • About Us
  • Contact us
  • Advertise
  • Privacy
  • Terms of Use

GUIDES

  • iOS & iPadOS
  • Apple ID
  • iCloud
  • App Store
  • iTunes
  • FaceTime
  • iMessage
  • Siri
  • Books and iBooks
  • Game Center
  • AirPlay

CONNECT

  • Facebook
  • Twitter
  • FeedBurner
  • YouTube

© Copyright 2010-2024 Guiding Tech Media · All Rights Reserved

This site and its content are in no way affiliated or endorsed by Apple, Inc. · Reproduction without explicit permission is prohibited

Last Updated on April 4, 2019 by Sudz Kar