文件、目录写保护
时间:2006-01-24 来源:cnscn2008
[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
[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
相关阅读 更多 +
排行榜 更多 +