CHATTR( 1 )
名称

               chattr  -   修改linux系统上的文件属性


概要

               chattr     [ -RVf  ]    [ -v  version]    [ mode ]    files...


描述
               chattr 修改linux系统上的文件属性

               

             符号模式的格式    +-=[acdeijstuADST] 。

             操作符 + 将所选的属性添加到文件属性中;操作符 - 与此相反;操作符 = 将文件属性设置为所给予的属性。


             [hEIXZ]属性只读,可能在lsattr中列出。



选项

               -R    递归操作

               -V    显示详细的命令输出,并打印程序版本。

               -f    抑制大多数的错误消息。

             

             -v    version    设置文件的版本号。


属性

            (A)    no atime updates :  文件访问时间将不会修改。


            (a)    apend only  : 文件只能添加数据(不能删除,不能修改)


              (c)    compressed : 自动压缩文件,打开文件时自动解压缩。

            (D)    synchronous directory updates : 当文件夹设置 " D " 属性,数据将会同步写入磁盘中。


            (d)    no dump : 当dump程序运行时不会被备份。


              (i)    immutable  : 不能被修改:不能被删除或重命名,无法创建连接到此文件,不能写操作

            (j)    data  journalling  : 所有的数据在写进文件前,会先写入到ext3日记中。


              (s)    secure  deletion : 文件将完全从磁盘中删除。

            (S)    synchronous updates : 文件修改将"同步"到磁盘中。


              (T)    and top of directory hierarchy :
       A directory with the 'T' attribute will be deemed to be the top of
       directory hierarchies for the purposes of the Orlov block allocator.
       This is a hint to the block allocator used by ext3 and ext4 that the
       subdirectories under this directory are not related, and thus should
       be spread apart for allocation purposes.   For example it is a very
       good idea to set the 'T' attribute on the /home directory, so that
       /home/john and /home/mary are placed into separate block groups.  For
       directories where this attribute is not set, the Orlov block
       allocator will try to group subdirectories closer together where
       possible.
              (t)    no tail  merging : 不允许尾部的块碎片与其他文件合并。

            (u)    undeletable : 删除时,其内容还保留在磁盘中。


              (e)    extent  format : 用来指示使用的是ext文件系统格式。 该属性无法用chattr移除。

              (E)    compression error :  实验性的指示压缩错误。

            (I)    indexed directory :  指示一个文件夹用哈希树索引。


            (h)    huge  file  : 用文件系统的块大小来作为储存块的单位,而不是用扇区的单位,这往往意味着这个文件大于(或在某时大于)2TB


              (X)  compression  raw  access  :
            The 'X' attribute is used by the experimental compression patches toindicate that a raw contents of a compressed file can be accessed directly.  It currently may not be set or reset using chattr(1),although it can be displayed by lsattr(1).

            (Z) compressed dirty file : 实验性的压缩补丁用来指示下流的压缩文件。

           The 'Z' attribute is used by the experimental compression patches to indicate a compressed file is dirty.  It may not be set or reset using chattr(1), although it can be displayed by lsattr(1).


                           详细英文文档chattr(1)