chattr - 修改linux系统上的文件属性
chattr [ -RVf ] [ -v version] [ mode ] files...
符号模式的格式 +-=[acdeijstuADST] 。
操作符 + 将所选的属性添加到文件属性中;操作符 - 与此相反;操作符 = 将文件属性设置为所给予的属性。
[hEIXZ]属性只读,可能在lsattr中列出。
选项
-v version 设置文件的版本号。
(A) no atime updates : 文件访问时间将不会修改。
(a) apend only : 文件只能添加数据(不能删除,不能修改)
(D) synchronous directory updates : 当文件夹设置 " D " 属性,数据将会同步写入磁盘中。
(d) no dump : 当dump程序运行时不会被备份。
(j) data journalling : 所有的数据在写进文件前,会先写入到ext3日记中。
(S) synchronous updates : 文件修改将"同步"到磁盘中。
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.
(u) undeletable : 删除时,其内容还保留在磁盘中。
(I) indexed directory : 指示一个文件夹用哈希树索引。
(h) huge file : 用文件系统的块大小来作为储存块的单位,而不是用扇区的单位,这往往意味着这个文件大于(或在某时大于)2TB
(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)