欢迎来到 岁月小筑

Cannot remove file (Operation not permitted)

Have you ever tried to delete a file however the system shows Operation not permitted, even if you are the root user? Here is one of the possibilities.

When I use Centos, I have ever tried to meet this situation.

I found so many methods, however none of them works for me.

Finally, I found the answer of this question: chattr.

chattr is a higher-level file attributes command, it can be only use for superuser. And lsattr is to show file attributes. For example:

You can see, the file 1.t has an “i”, it means Immutable. So we just should remove the immutable attribute, and then we can remove the file.

chattr -i 1.t

Now, you can delete the file as you want to.

 

点赞
  1. StephanyX says:

    Hi admin i see you don't monetize your page. You can earn additional bucks easily,
    search on youtube for: how to earn selling articles

Leave a Reply

Your email address will not be published.