Linux chattr命令:更改文件和目录的属性。 Linux chattr命令 功能描述 使用chattr命令可以更改文件和目录的属性。 Linux chattr命令 语法 chattr [选项] [属性设置] [文件|目录] BashCopy 命令中各选项的含义如下表所示。 chattr命令属性设置描述如下表所示。 Linux chattr命令 示例 设置/root/install.log文件具有i属性 [root@rhel ~]# chattr +i /root/install.log BashCopy 去除/root/install.log文件的i属性 [root@rhel ~]# chattr -i /root/install.log BashCopy 给/root/www目录,以及该目录下的文件和子目录添加u属性 [root@rhel ~]# chattr -R +u /root/www BashCopy