Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I try to delete a file

sudo rm -rf filename

I get spit back:

rm: filename: Resource is busy

How can I override this? I know for a fact that the resource is not busy. I just want to delete it!

share|improve this question
1  
The operating system says it is. Should we trust the computer or the human? Do you have the file selected in any GUI? Is it actually a directory (noting that you used the -r flag)? Is it perhaps open in a background or zombied process? – paddy Feb 12 at 22:26
I said I am sure it is not in use. Trust me...I am sure. I have closed, restarted, ended processes, etc etc. Please just trust me and answer the question... – CodeGuy Feb 12 at 22:29
And so you are therefore certain that the file is not being used by a process that is started when your system starts? The key to being a good problem solver is to not trust anything you're told. I don't trust you, and I don't trust your operating system. With a level playing field, we can make some progress into understanding what is going on. If we accept all your assumptions as true, we will make no further progress than you have already, and look where you are right now. – paddy Feb 12 at 22:33
Okay....blah blah. Let's just focus. Assuming I am correct, how would one go about forcing a delete. That is the question at hand... – CodeGuy Feb 12 at 22:36
1  
Then I misunderstood the last part of your question where you say "I just want to delete it!" You don't seem open to advice on how to achieve this, so I recommend you continue to follow your own path without asking for help. – paddy Feb 12 at 23:01
show 4 more comments

migrated from stackoverflow.com Feb 12 at 23:22

3 Answers

You have demanded an answer to your question, ignoring all discussion along the way, and providing attitude to boot. I find your comments both ignorant and insulting, given that I am taking time to work through a problem that has absolutely no significance to me. You have also ignored the existing answer by Paul Tomblin where he asks if you have tried lsof.

So here is my answer: 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. You have not accepted this as a course of action to try.

In future, please consider the manner in which you ask for and receive help from others. If you are unwilling to take advice or answer questions, do not ask for help.

share|improve this answer

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.

share|improve this answer
It is not busy....trust me. Please just answer the question :) – CodeGuy Feb 12 at 22:30
2  
Did you try the command? Unix usually doesn't lie about things just to mess with you. – Paul Tomblin Feb 12 at 22:31

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...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.