Extended Attributes

Extended File Attributes on Linux

chattr

chattr - change (extended) file attributes on a Linux file system

Man Page

Syntax

chattr [ -RVf ] [ -v version ] [ mode ] files...

Description

The format of a symbolic mode is +-=[acdeijstuADST].

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.

The letters 'acdeijstuADST' 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), 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).

lsattr

lsattr - list (extended) file attributes on a Linux second extended file system

Man Page

Syntax

lsattr [ -RVadv ] [ files...]

Options

Option

Description

-R

Recursively list attributes of directories and their contents.

-V

Display the program version.

-a

List all files in directories, including files that start with '.'.

-d

List directories like other files, rather than listing their contents.

-v

List the file's version/generation number.

removexattr

Remove extended attributes.

Last updated