Ext4

lsattr的輸出是什麼意思

  • March 9, 2014

我想知道輸出是什麼意思lsattr。當我嘗試過時,它的列印如下所示lsattr /usr

$ lsattr /usr
-----------------e- /usr/local
-----------------e- /usr/src
-----------------e- /usr/games
--------------I--e- /usr/include
--------------I--e- /usr/share
--------------I--e- /usr/lib
-----------------e- /usr/lib32
--------------I--e- /usr/bin
--------------I--e- /usr/sbin

我已經閱讀了手冊頁,chattrlsattr仍然不知道。

手冊頁chattr包含理解lsattr輸出所需的所有資訊。

摘抄

   The letters `acdeijstuACDST' select the new attributes for the files: 
   append only (a), compressed (c), no dump (d), extent format (e),  
   immutable (i),  data  journalling  (j),  secure deletion (s), no 
   tail-merging (t), undeletable (u), no atime updates (A), no copy on 
   write (C), synchronous directory updates (D), synchronous updates (S), 
   and top of directory hierarchy (T).

   The following attributes are read-only, and may be listed by lsattr(1) 
   but not modified by chattr: huge file (h), compression error (E), 
   indexed directory (I), compression raw access (X), and compressed dirty 
   file (Z).

如果您在同一手冊頁中進一步查看標籤的描述:

   The 'e' attribute indicates that the file is using extents for mapping 
   the blocks on disk.  It may not be removed using chattr(1).

   The 'I' attribute is used by the htree code to indicate that a directory 
   is being indexed using hashed trees.  It may not be set or  reset  using
   chattr(1), although it can be displayed by lsattr(1).

引用自:https://unix.stackexchange.com/questions/32256