removexattr(2)

โœจ removexattr(2) โ€” the system calls manual, bestie edition โœจ

okay so this is the page for removexattr, lremovexattr, and fremovexattr, living in the System Calls Manual section of the Linux man-pages. we're removing extended attributes today and we're gonna be so normal about it ๐Ÿ’…


๐ŸŒธ NAME ๐ŸŒธ

removexattr, lremovexattr, fremovexattr โ€” remove an extended attribute

๐ŸŽ€ LIBRARY ๐ŸŽ€

Standard C library (libc, -lc)

๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

#include <sys/xattr.h>

int removexattr(const char *path, const char *name);
int lremovexattr(const char *path, const char *name);
int fremovexattr(int fd, const char *name);

๐Ÿ’– DESCRIPTION ๐Ÿ’–

Extended attributes are name:value pairs that are attached to inodes โ€” so like, files, directories, symbolic links, the whole friend group. they're basically extra little add-ons to the normal attributes every inode in the system already has (you know, the stat(2) data). if you want the full lore on how extended attributes work as a concept, xattr(7) has the complete overview, go read it, it's giving textbook energy ๐Ÿ“š

removexattr() removes the extended attribute identified by name that's associated with the given path in the filesystem. bye bestie ๐Ÿ‘‹

lremovexattr() is identical to removexattr(), except when we're dealing with a symbolic link โ€” in that case the extended attribute gets removed from the link itself, not from the file the link points at. no cap, that distinction matters.

fremovexattr() is also identical to removexattr(), except the extended attribute is removed from the open file referred to by fd (the fd you got back from open(2)) instead of from path.

an extended attribute name is a null-terminated string. the name includes a namespace prefix, and there may be several, disjoint namespaces hanging off a single individual inode. it's giving polyamorous namespacing ๐Ÿซถ

๐Ÿ”ฅ RETURN VALUE ๐Ÿ”ฅ

  • slay: on success, zero is returned โœจ
  • not slay: on failure, -1 is returned and errno is set to indicate the error ๐Ÿ’€

๐Ÿ’œ ERRORS ๐Ÿ’œ

  • ENODATA โ€” the named attribute does not exist. it's not there. it never was. it's not hiding. ๐Ÿ˜ญ
  • ENOTSUP โ€” extended attributes are not supported by the filesystem, or they're disabled. the filesystem said "not my thing" ๐Ÿ™ˆ
In addition, the errors documented in stat(2) can also occur. so like, don't think you've seen the last of them.

โญ STANDARDS โญ

Linux. ๐Ÿ‘‘

๐ŸŒˆ HISTORY ๐ŸŒˆ

Linux 2.4, glibc 2.3. vintage, but make it iconic.

๐Ÿงš SEE ALSO ๐Ÿงš

getfattr(1), setfattr(1), getxattr(2), listxattr(2), open(2), setxattr(2), stat(2), symlink(7), xattr(7)


and that's the whole page, bestie, no notes ๐Ÿ’– this one came from Linux man-pages 6.20, dated 2026-02-08 โ€” so go forth and remove those attributes, you absolute main character ๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from
  • arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • ๐Ÿ“œ the page's license: GPL-2.0-or-later
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms