GETFATTR(1)
โจ getfattr โ bestie edition โจ
okay so this is getfattr(1), a lil tool from the File Utilities corner of your system, and it's genuinely one of my faves. no cap.
๐ธ NAME ๐ธ
getfattr โ get extended attributes of filesystem objects ๐
like, the lil secret extra tags that files carry around that nobody talks about. iykyk.
๐ SYNOPSIS ๐
getfattr [-hRLP] -n name [-e en] pathname...
getfattr [-hRLP] -d [-e en] [-m pattern] pathname...
two whole modes, bestie. either you're asking for one specific attribute by name, or you're doing a full dump of everything that matches. pick your fighter ๐
๐ฆ DESCRIPTION ๐ฆ
So for each file you hand it, getfattr shows you the file name, and then the whole set of extended attribute names โ and optionally their values too โ that are attached to that file. by default it only shows you attributes in the user namespace, and if you're like "wait, why" the answer is over in -m, keep scrolling ๐ซถ
The output format of getfattr -d is exactly this vibe:
1: # file: somedir/
2: user.name0="value0"
3: user.name1="value1"
4: user.name2="value2"
5: ...
Line 1 is the file name for which the lines after it are being reported โ that's the little label telling you whose attributes you're looking at. The remaining lines (lines 2 to 4 up there) show the name and value pairs associated with the file you specified. cute, right? ๐
๐ OPTIONS ๐
-n name,--name=nameโ dump the value of the named extended attribute. just the one you asked for, main character treatment โจ-d,--dumpโ dump the values of all matched extended attributes. the full haul, the whole fit ๐-e en,--encoding=enโ encode values after retrieving them. valid values of en are"text","hex", and"base64". values encoded as text strings get wrapped in double quotes ("), while strings encoded as hexadecimal and base64 are prefixed with0xand0s, respectively. so you always know which one you're looking at ๐-h,--no-dereferenceโ do NOT dereference symlinks. instead of the file the symlink points at, the symlink itself is what gets examined. it's giving "i said what i said" ๐ค-m pattern,--match=patternโ only include attributes whose names match the regular expression pattern. the default value for pattern is"^user\\.", which grabs all the attributes in theusernamespace. specify"-"if you wanna include all attributes, no filtering, chaos mode. refer toxattr(7)for a much more detailed discussion of namespaces, fr fr ๐--absolute-namesโ do not strip leading slash characters (/). the default behaviour is to strip leading slash characters. so this flag is you saying "leave my slashes alone" ๐--only-valuesโ dump out the raw extended attribute value(s) without encoding them. no quotes, no prefixes, no makeup, just the raw data ๐-R,--recursiveโ list the attributes of all files and directories recursively. this option is commonly used together with option-h. they're a package deal, honestly ๐ซถ-L,--logicalโ logical walk, recurse into symbolic links that refer to a directory. only effective in combination with-R. the default behaviour is to recurse into symbolic links given on the command line, and not to recurse into symbolic links encountered in subdirectories. so this is you opting into the extra โจ-P,--physicalโ physical walk, do not recurse into symbolic links that refer to a directory. only effective in combination with-R. (for pathnames given on the command line, this option applies only to the final component; preceding path components may still be symbolic links.) lowkey a lot of nuance but we respect it ๐--versionโ print the version ofgetfattrand exit. quick lil flex, then bye ๐--helpโ print help explaining the command line options. when in doubt, ask ๐ฆ--โ end of command line options. all remaining parameters are interpreted as file names, even if they start with a dash character. this is the "okay we're done with flags now" line, iconic behaviour โญ
๐ AUTHOR ๐
Andreas Gruenbacher, <andreas.gruenbacher@gmail.com> and the SGI XFS development team, <linux-xfs@oss.sgi.com>. legends, honestly ๐
Please send your bug reports or comments to <https://savannah.nongnu.org/bugs/?group=attr> or <acl-devel@nongnu.org>. they wanna hear from you, bestie, don't be shy ๐ซถ
๐ SEE ALSO ๐
mwah ๐ this page is from the Extended Attributes manual, dated Dec 2001 โ yeah she's been around a while and she still ate. periodt. ๐โจ
๐ฆ where this page comes from
- arch rolling: attr 2.6.0-1 ยท LGPL-2.1-or-later AND GPL-2.0-or-later
- centos-stream 10: attr 2.6.0-2.el10 ยท GPL-2.0-or-later
- centos-stream 9: attr 2.6.0-2.el9 ยท GPLv2+
- fedora 43: attr 2.6.0-1.fc43 ยท GPL-2.0-or-later
- fedora 44: attr 2.6.0-1.fc44 ยท GPL-2.0-or-later
- nixpkgs unstable: attr 2.6.0
- opensuse-leap 16.0: attr 2.6.0-160000.1.1 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: attr 2.6.0-160000.1.1 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: attr 2.6.0-160000.1.1 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: attr 2.6.0-160000.1.1 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- Copyright (C) 2002, 2004, 2007 Silicon Graphics, Inc. All rights reserved
- Copyright (C) 2002, 2004, 2007 Andreas Gruenbacher <agruen@suse.de>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms