chattr — Change file attributes


chattr [-RVf] [ { + | - | = } MODE ...] [FILE...]

chattr -H | -v


  -R, --recursive     recursively apply the changes to directories and
                      their contents
  -V, --verbose       Be verbose during operation
  -f, --force         suppress error messages
  -H, --help          this help text
  -v, --version       display the program version


The chattr program allows to change file attributes, namely DOS attributes, as well as making files sparse, encrypt or compress them on FS level, or setting directories' case sensitivity.

The format of 'mode' is {+-=}[acCehnrsSt]

The operator '+' causes the selected attributes to be added to the existing attributes of the files; '-' causes them to be removed; and '=' causes them to be the only attributes that the files have. A single '=' causes all attributes to be removed.

Supported attributes:

  'r', 'Readonly':      file is read-only
  'h', 'Hidden':        file or directory is hidden
  's', 'System':        file or directory that the operating system uses
  'a', 'Archive':       file or directory has the archive marker set
  't', 'Temporary':     file is being used for temporary storage
  'S', 'Sparse':        file is sparse
  'c', 'Compressed':    file or directory is compressed
  'n', 'Notindexed':    file or directory is not to be indexed by the
			content indexing service
  'e', 'Encrypted':     file is encrypted
  'C', 'Casesensitive': directory is handled case sensitive
			(Windows 10 1803 or later, local NTFS only,
			 WSL must be installed)