---
name: "xattr"
section: "1"
platform: "linux"
package: "xattr"
version: "0.10.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/xattr"
---

# xattr(1)

sets or lists extended attributes on a file or directory

## NAME

xattr - sets or lists extended attributes on a file or directory

## SYNOPSIS

**xattr** \[ *-lz* \] **filename** \[ **filename** ... \]\
 **xattr** *-p* \[ *-lz* \] *attr\_name* **filename** \[ **filename** ... \]\
 **xattr** *-w* \[ *-z* \] *attr\_name* *attr\_value* **filename** \[ **filename** ... \]\
 **xattr** *-d* *attr\_name* **filename** \[ **filename** ... \]\

## DESCRIPTION

This manual page documents briefly the **xattr** command.

The first form lists the names of all xattrs on the given file(s).\
 The second form (-p) prints the value of the xattr attr\_name.\
 The third form (-w) sets the value of the xattr attr\_name to attr\_value.\
 The fourth form (-d) deletes the xattr attr\_name.\

## OPTIONS

A summary of options is included below.

- **-h**

  Show summary of options.

- **-l**

  Print long format (attr\_name: attr\_value) when listing xattrs.

- **-z**

  Compress or decompress (if compressed) attribute value in zip format.

## EXAMPLES

- **xattr -w user.mykey myvalue myfile**

  - **xattr -p user.mykey myfile**

  - **xattr -d user.mykey myfile**

  ## SEE ALSO

The Python module "xattr"\

## AUTHOR

xattr was written by Bob Ippolito \<bob@redivi.com\>.

This manual page was written by Federico Ceratto, for the Debian project (and may be used by others).
