ITPub博客

首页 > Linux操作系统 > Linux操作系统 > redhat5 linux chattr控制文件及目录的一些特殊属性

redhat5 linux chattr控制文件及目录的一些特殊属性

原创 Linux操作系统 作者:wisdomone1 时间:2013-06-05 11:03:07 0 删除 编辑

[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/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
提供针对oracle初学者及进阶的数据库培训,欢迎大家咨询: 微信: wisdomone 微信公众号: lovedb 工作经历: 中国普天 北京科蓝 北京云和恩墨 北京神州新桥

注册时间:2008-04-04

  • 博文量
    2189
  • 访问量
    12689910