ITPub博客

首页 > 应用开发 > IT综合 > 文件、目录写保护(转)

文件、目录写保护(转)

原创 IT综合 作者:ba 时间:2007-08-16 15:18:45 0 删除 编辑
文件、目录写保护(转)[@more@][root@book ~]# touch a.txt

[root@book ~]# chattr +i a.txt

[root@book ~]# rm -f a.txt
rm: cannot remove `a.txt': Operation not permitted

[root@book ~]# ls
anaconda-ks.cfg a.txt Desktop firstboot.1120181163.33 install.log install.log.syslog

[root@book ~]# chattr -i a.txt

[root@book ~]# rm -f a.txt

[root@book ~]# ls
anaconda-ks.cfg Desktop firstboot.1120181163.33 install.log install.log.syslog


[root@test tmp]# mkdir tmp
[root@test tmp]# chattr +i tmp
[root@test tmp]# rm -fr tmp
rm: cannot remove directory `tmp': Operation not permitted

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10617731/viewspace-962006/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: shell数组(转)
请登录后发表评论 登录
全部评论
  • 博文量
    1621
  • 访问量
    4429920