XATTR(1)

πŸ“¦
version 1.3.0 Β· 2 versions
  • 1.3.0 Β· debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 479 Β· nixpkgs unstable
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ XATTR ✨

okay bestie so this is the xattr manual page β€” a whole little command for setting or listing extended attributes on a file or directory. yes. that's the whole vibe. let's get into it πŸ’…


🌸 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 ... ]

four forms, four moods, all iconic πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

So this page documents the xattr command briefly β€” that's literally what it says, not me being lazy, okay? 😭

Anyway here's the tea, form by form:

  • 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.

that's it. that's the whole flow. no cap ✨


πŸŽ€ OPTIONS πŸŽ€

A summary of options is included below. bestie we LOVE a summary 🫢

  • -h β€” Show summary of options. tiny help menu moment.
  • -l β€” Print long format (attr_name: attr_value) when listing xattrs. so you get the receipts, not just the names πŸ’–
  • -z β€” Compress or decompress (if compressed) attribute value in zip format. little zip-zip situation 🧚

πŸ”₯ EXAMPLES πŸ”₯

here's what it actually looks like in the wild, copy-paste core:

xattr -w user.mykey myvalue myfile
xattr -p user.mykey myfile
xattr -d user.mykey myfile

set it, peek at it, delete it. the whole arc in three commands 😭✨


πŸ‘€ SEE ALSO πŸ‘€

The Python module "xattr" β€” yeah there's a whole Python side to this too, iykyk 🐍


πŸ’œ AUTHOR πŸ’œ

xattr was written by Bob Ippolito <bob@redivi.com>. legend behaviour, honestly.

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


okay and the cute lil sign-off at the bottom: this page lives in the General Commands Manual, it's version/datestamp May 8, 2010, and it goes by XATTR(1). periodt πŸ’…πŸŒˆ

go forth and set some attributes, bestie πŸ¦‹

πŸ“¦ where this page comes from