nerdexam
Linux_Foundation

LFCS · Question #370

Which command will list all of the extended attributes on the file afile.txt along with the values?

The correct answer is D. getfattr dump afile.txt. The getfattr command is used to retrieve extended attributes, and a specific option is required to display all attribute names along with their values.

Submitted by obi.ng· Apr 18, 2026Essential Commands

Question

Which command will list all of the extended attributes on the file afile.txt along with the values?

Options

  • Agetfattr all afile.txt
  • Bgetfattr afile.txt
  • Cgetfattr list afile.txt
  • Dgetfattr dump afile.txt

How the community answered

(29 responses)
  • A
    3% (1)
  • B
    7% (2)
  • D
    90% (26)

Why each option

The `getfattr` command is used to retrieve extended attributes, and a specific option is required to display all attribute names along with their values.

Agetfattr all afile.txt

The `all` keyword is not a valid option for `getfattr` to list all attributes with their values; the correct option for this purpose is `--dump` or `--all-known`.

Bgetfattr afile.txt

Running `getfattr` without any specific options typically does not display all attribute names and values; it usually requires `-d` or `-n` to specify what to retrieve.

Cgetfattr list afile.txt

The `list` keyword is not a recognized option for the `getfattr` command to display attributes and their values.

Dgetfattr dump afile.txtCorrect

The `getfattr --dump` (or its shorthand `-d`) option is specifically designed to list all extended attribute names and their associated values for the specified file, making it the correct command.

Concept tested: Listing Linux Extended Attributes (getfattr)

Source: https://linux.die.net/man/1/getfattr

Topics

#getfattr command#extended attributes#file attributes#file management

Community Discussion

No community discussion yet for this question.

Full LFCS Practice