Files that root can't delete in linux

Today we deploy a new set of centos 7.4, mount the old data disk, when clearing the data in the original old data disk, there are two files that cannot be deleted, and renaming will not work, I can use the root account

chmod doesn't work either. After thinking about it, the file attributes may have to be changed. That has to be changed back

Use chattr.

[root@iZ94qqcxarpZ www]# rm -rf java.log
rm: cannot remove ‘java.log’: Operation not permitted
[root@iZ94qqcxarpZ www]# lsattr
----i----------- ./java.log
----i----------- ./03618.log

Sure enough, the file attribute was added i
[root@iZ94qqcxarpZ www]# chattr -i *
[root@iZ94qqcxarpZ www]# lsattr
---------------- ./java.log
-- -------------- ./03618.log

 

All right

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326359541&siteId=291194637