天天看點

linux chattr   --   修改linux檔案屬性

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).

繼續閱讀