Linux: File Attributes

From Define Wiki
Jump to navigation Jump to search

Beyond the normal permissions files can have attributes set to control how a file can be used.

Change and Set Attributes

chattr +<attribute> <file>

chattr -<attribute> <file>

Attributes

  • Append Only (a)

Prevents deletion, text can only be added to the end of the file.

  • no dump (d)

Prevents backups with the dump command

  • extent format (e)

Set with ext file system - cannot be removed

  • immutable (i)

No Deletion or changes Possible

  • indexed (l)

Set indexes for searching - cannot be removed