Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how to force delete a directory when it says permission denined -> even with root access

I was just working on my kernel project. when I extracted the .iso file, I got everything I expected, all except for that the "boot" and "system" directories were with some lock symbol to free up space, I deleted the files (outside the directories) but unable to delete those 2 folders in the "files" application – even the content.

While using rmdir in the terminal, it says "permission denied", even with root access. (also tried "sudo rmdir").

How to fix, please?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

First, try removing it recursively and forcefully:

 sudo rm -rf /path/to/directory

If sudo is not working then try logging in as root to recursively delete the directory:

sudo su                  # Login as root 
rm -rf /path/to/directory           # remove the directory 
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading