When you install any programs with root access on Linux-based operating systems, you may receive a Permission Denied error if you try to delete the remaining files or folders. As a result, you cannot delete the file or folder.

How to Delete an Undeleted File or Folder in Linux
For example, you are using the Linux Mint or Ubuntu operating system, and you have created a new file/folder on the desktop. Since you are logged in to the system with a non-root user, you can quickly delete the file/folder you created.
However, in some cases, when you install a program that requires root access, you may encounter files and folders that cannot be deleted anywhere or on the desktop. Therefore, when you try to delete these files and folders, you will usually receive a Permission Denied error.
On Linux, you can use Terminal to delete such files and folders that cannot be deleted. You can delete files that cannot be deleted using the Linux RM command by switching to Root in the Terminal.
How to Remove Files and Folders by Using Terminal on Ubuntu, Debian, Linux Mint, Kali Linux
We will use the Linux RM command to delete an indelible folder that we encountered on Linux Mint 18/19. On Linux, you can delete files, directories, and folders using the RM command.
To remove files on Linux or delete folders, follow the steps below.
Step 1
As you can see in the image below, there is a folder on Linux Mint that cannot be deleted. When you try to delete it, you will usually receive a Permission Denied error.
Try to delete the vmware-tools-distrib folder as follows.

Step 2
You will receive a Permission Denied error, as in the image below.

Step 3
Open the Terminal on Linux and execute sudo su to access Root, then type your root password and press Enter.
It is very normal to forget your root password if you have not used it for some time. Do not panic if you cannot get into the system for a short time. Let us look at a simple plan. You can reset your root password by starting in recovery mode. It is easier than you think. After you finish, you can go back to using the delete commands where you stopped.

Step 4
On Linux, you can use the ls command to display the directory in your current location. To delete the undeleted folder, execute rm -rf vmware-tools-distrib.
rm -rf vmware-tools-distrib
Step 5
As soon as you execute the “rm -rf vmware-tools-distrib” command, you can see that the folder has been elected.

Deleting a File That Cannot Be Deleted ⇒ Video
To delete an undeletable file or folder on Linux Mint 18/19, you can watch the video below and also subscribe to our YouTube channel to support us!
Frequently Asked Questions About Stubborn Files in Linux
Why do I suddenly get a ‘Permission Denied’ error when trying to delete an ordinary folder on the desktop?
When I type ‘sudo su’ in the terminal, nothing appears on the screen?
What do the letters ‘rf’ do in the ‘rm -rf’ command you just mentioned? Can such a simple command crash the system?
Do I have a chance to handle undeletable files with a file manager in the graphical interface without entering the terminal?
I deleted the file but it did not go to the trash at all, it just vanished. Did I do something wrong?
What can I do to avoid dealing with these leftover folders from software installations constantly?
The package manager can sometimes get stuck in the middle of a job. Unfinished installations are very annoying. If you do not notice this, uninstalling will also freeze. The good news is there are very clear ways to fix problems with the dpkg package manager.
Conclusion
In this article, we have examined step-by-step how to delete permission-denied files or folders. Thanks for following us!


10 People Shared Their Experience
thanks
You’re welcome!
thank you !
You’re welcome!
thanks for the helpful article.
You’re welcome. Thanks for your comment.
Thanks for the article !!!
Such a helpful and easy to understand Great work !!!
You’re welcome!
Thanks
You’re welcome!