[root@rhel5 ~]# touch /nbfile
[root@rhel5 ~]# ls -l /nbfile
-rw-r--r-- 1 root root 0 Jun 5 02:57 /nbfile
--chattr命令简介
[root@rhel5 ~]# chattr --help
Usage: chattr [-RV] [-+=AacDdijsSu] [-v version] files...
-- i属性即不能对此文件进行增加,修改,删除
[root@rhel5 ~]# chattr +i /nbfile
--删除报错了
[root@rhel5 ~]# rm /nbfile
rm: remove write-protected regular empty file `/nbfile'? y
rm: cannot remove `/nbfile': Operation not permitted
[root@rhel5 ~]# ls -l /nbfile
-rw-r--r-- 1 root root 0 Jun 5 02:57 /nbfile
--具体chattr命令用法
man chattr
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-763030/ ,如需转载,请注明出处,否则将追究法律责任。