[wxh@mu01 bu_neng_shan]$ lsattr
-----a--------- ./test #a属性
[wxh@mu01 bu_neng_shan]$ cat test
aaaaa
ok
[wxh@mu01 bu_neng_shan]$ echo 3333 >> test #追加3333
[wxh@mu01 bu_neng_shan]$ cat test
aaaaa
ok
3333 #追加成功
[wxh@mu01 bu_neng_shan]$
[wxh@mu01 bu_neng_shan]$ rm test
rm: cannot remove 'test': Operation not permitted #不能删除
[wxh@mu01 bu_neng_shan]$ vi test #不能编辑
[wxh@mu01 bu_neng_shan]$ lsattr
----i---------- ./test
[wxh@mu01 bu_neng_shan]$
[wxh@mu01 bu_neng_shan]$ rm test
rm: remove write-protected regular file 'test'? y
rm: cannot remove 'test': Operation not permitted #不能删除
[wxh@mu01 bu_neng_shan]$ echo 3333 >> test
-bash: test: Permission denied #不能追加
[wxh@mu01 bu_neng_shan]$ lsattr -d ../bu_neng_shan/
-----a--------- ../bu_neng_shan/
[wxh@mu01 bu_neng_shan]$ touch 222
[wxh@mu01 bu_neng_shan]$ ls
222 test #能追加
[wxh@mu01 bu_neng_shan]$ lsattr
--------------- ./test
--------------- ./222
[wxh@mu01 bu_neng_shan]$
[wxh@mu01 bu_neng_shan]$
[wxh@mu01 bu_neng_shan]$ rm test
rm: cannot remove 'test': Operation not permitted #不能删除
[root@mu01 bu_neng_shan]# chattr -a +i ../bu_neng_shan/
[root@mu01 bu_neng_shan]# lsattr -d ../bu_neng_shan/
----i---------- ../bu_neng_shan/
[root@mu01 bu_neng_shan]#
[wxh@mu01 bu_neng_shan]$
[wxh@mu01 bu_neng_shan]$ lsattr
--------------- ./test
--------------- ./222
[wxh@mu01 bu_neng_shan]$
[wxh@mu01 bu_neng_shan]$ lsattr -d ../bu_neng_shan/
----i---------- ../bu_neng_shan/
[wxh@mu01 bu_neng_shan]$ touch 333
touch: cannot touch '333': Permission denied #不能追加
[wxh@mu01 bu_neng_shan]$ rm test
rm: cannot remove 'test': Permission denied #不能删除