Override "resource is busy" when rm on Mac OS X Terminal

Try lsof filename to see if it's really busy. One of the most common causes of this is that you're trying to remove a directory that you have a shell open in.


You cannot override this behaviour.

The operating system states that it is busy. The operating system is probably correct. The error message could be for these reasons:

  • the file is actually being used by another process
  • there is a problem with your file system

As you wish to delete the file, my suggestion has been to boot the machine from a linux image, mount your file system and delete the file.


As other posters say, if you know better then the OS, reboot the system and that will make it forget. But really, they know what they are talking about...


This is an old question but I'll add my 2 cents, because there are in fact situations where a file is not really in use but the OS still thinks it is.

It is possible for a file on a removable device to be in use during a system crash and the system will continue think the file is still in use, even if lsof returns nothing and the file is not really in use. Deleting .DS_store has no effect.

Temporarily, one can rename the file or folder if needed. Then whip out the disk utility and do repair disk/repair permissions on the volume.


All of the above. The system does not usually lie, meaning that sometimes it does.

Read on, because I had a unique situation in which none of the previously suggested solutions worked, but I did manage to solve my problem.

In my case the "busy" file was a .ttf TrueType font file on a "foreign disk" on a network attached drive, and therefore not likely to be opened by the system on startup. The lsof command showed nothing. A reboot of the mac did not change anything. Shutting down the only other computer on the network that might conceivably be using the file did not change anything.

Disk Utility couldn't do anything with the drive, because it wasn't just a removable device, it was a remote device, not attached directly to the Mac.

I copied the file with a new name, because in my case I wanted to rename it, not delete it. After copying I couldn't delete the original because it was still "busy."

I logged into the network attached drive and attempted to "check" the "foreign disk" but the check failed. But now I was able to delete the original file--in Finder, without using sudo or rm -f or anything like that. It was no longer "busy."