nerdexam
LPI

303-300 · Question #18

What is the purpose of an extended attribute in Linux?

The correct answer is A. To store additional metadata about a file. Extended attributes (xattrs) in Linux allow the filesystem to store arbitrary metadata beyond the standard file attributes (owner, permissions, timestamps) - making A correct. Common uses include SELinux security labels, ACLs, and user-defined tags stored as name-value pairs…

Access Control

Question

What is the purpose of an extended attribute in Linux?

Options

  • ATo store additional metadata about a file
  • BTo encrypt a file for secure transmission
  • CTo compress a file to save disk space
  • DTo mark a file as executable

How the community answered

(38 responses)
  • A
    89% (34)
  • B
    3% (1)
  • C
    3% (1)
  • D
    5% (2)

Explanation

Extended attributes (xattrs) in Linux allow the filesystem to store arbitrary metadata beyond the standard file attributes (owner, permissions, timestamps) - making A correct. Common uses include SELinux security labels, ACLs, and user-defined tags stored as name-value pairs accessible via getfattr/setfattr.

Why the distractors are wrong:

  • B (encryption): Encryption is handled by tools like GPG or filesystem-level encryption (e.g., fscrypt) - not xattrs. Security-related xattrs store labels, not ciphertext.
  • C (compression): Compression is a filesystem feature (e.g., btrfs, ZFS) or tool-level operation (gzip, zstd), entirely unrelated to extended attributes.
  • D (executable): The execute bit is part of standard POSIX permissions (chmod +x), not an extended attribute.

Memory tip: Think of extended attributes as "sticky notes" you can attach to a file - they don't change what the file is, they just let you tag it with extra information the OS or applications can read.

Topics

#Extended Attributes#File Metadata#Linux Filesystem#xattr

Community Discussion

No community discussion yet for this question.

Full 303-300 Practice