What Do I Do About "Device or Resource Busy" Messages?

Maybe you're trying to move or delete a file in Linux and get a "device or resource busy" message. Here's how to work around it.

The tool you want is lsof, which stands for list open files.

It has a lot of options, so check the man page, but if you want to see all open files under a directory:

lsof +D /path

That will recurse through the filesystem under /path, so beware doing it on large directory trees.

Once you know which processes have files open, you can exit those apps, or kill them with the kill(1) command.

Hope this helped you out.

-Until next time!

September 19 2021

Add or review comments

Please leave your comment

Existing comments

Comments 0