---

How to Fix “rm: cannot remove ‘file’: Device or Resource Busy” in Linux

When you see the message “device or resource busy”, it means that the file or directory is currently being used. Linux prevents you from deleting files that are in use to avoid breaking things or causing data loss.

Here are some common reasons why this happens:

You are trying to delete a directory that your terminal is currently inside.
A program or process is using the file or directory.
A device (like a USB drive or network mount) is still mounted and in use.
In this article, we’ll explain why this happens and how you can fix it.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis