# Extended Attributes

## chattr

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

### Man Page

{% embed url="<https://linux.die.net/man/1/chattr>" %}

### 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

{% embed url="<https://linux.die.net/man/1/lsattr>" %}

### 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.&#x20;

{% embed url="<https://man7.org/linux/man-pages/man2/removexattr.2.html>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://strangebutohwell.gitbook.io/knowledge/linux/file-system/file-management/extended-attributes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
