ubuntu文件隐藏属性(文件属性系列二)

lsattr    查看隐藏属性

  • -R  递归显示目录极其子目录隐藏属性
  • -V  显示程序版本
  • -a  列出所有文件隐藏属性
  • -d  如果接的是目录,仅列出目录属性而非其连接内容
  • -v  列出文件 版本/生成 号

chattr  改变隐藏属性

+ 增加    - 删除    = 设置为

  • -R  递归改变属性
  • -V  打印详细信息及程序版本
  • -f   不显示错误信息
  • -v  设置文件 版本/生成 号

隐藏属性含义:

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

a:只可添加内容,不能删除与修改(仅root才能设置)

A:访问此文件时,其访问时间atime不会修改,可避免I/O较慢的机器过度访问磁盘

c:设置该属性后会自动压缩,读取时会自动解压缩

d:当执行dump程序时,该属性使该文件不会被dump备份

D:对文件夹的更改会同步写入磁盘(针对目录)

S:对文件的改变会同步写入磁盘(针对文件)

e:该文件使用硬盘映射出来的一块扩展区域(该属性无法被chattr删除)

i:该文件无法被修改,删除,无法被链接(仅root才能设置)

s:设置该属性的文件被删除时会彻底删除

u:与s相反,被删除时可恢复

C:不受copy-on-write 更新的影响(应被用于新的或空的文件中)

E:该属性作为实验性的压缩补丁使用,表示一个被压缩文件存在压缩错误(该属性无法被chattr设置或重置)

h:该文件很大,起码大于2TB,以文件系统块而不是扇区为单位(该属性无法被chattr设置或重置)

I:  The 'I' attribute is used by the htree code to indicate that a directory is being indexed using hashed  trees.  (该属性无法被chattr设置或重置)

...........算了不翻了,翻的我脑壳疼

posted @ 2018-11-17 14:26  xiaoblue  阅读(1028)  评论(0)    收藏  举报