nerdexam
Linux_Foundation

LFCS · Question #368

Which command will set the user.author attribute on the file afile.txt?

The correct answer is B. setfattr n user.author v "A. Author" afile.txt. The setfattr command is used to set extended attributes on a file, requiring specific options to define the attribute name and its corresponding value.

Submitted by rohit_dlh· Apr 18, 2026Essential Commands

Question

Which command will set the user.author attribute on the file afile.txt?

Options

  • Asetfattr user.author:"A. Author" afile.txt
  • Bsetfattr n user.author v "A. Author" afile.txt
  • Csetfattr user.author="A. Author" afile.txt
  • Dsetfattr a user.author="A. Author" afile.txt

How the community answered

(14 responses)
  • B
    86% (12)
  • C
    7% (1)
  • D
    7% (1)

Why each option

The `setfattr` command is used to set extended attributes on a file, requiring specific options to define the attribute name and its corresponding value.

Asetfattr user.author:"A. Author" afile.txt

The syntax `user.author:"A. Author"` is incorrect for `setfattr` as it does not properly separate the attribute name and value with the required options.

Bsetfattr n user.author v "A. Author" afile.txtCorrect

The `setfattr` command requires the attribute name to be specified using the `-n` or `--name` option, and the attribute value to be specified using the `-v` or `--value` option, making `setfattr -n user.author -v "A. Author" afile.txt` the correct syntax.

Csetfattr user.author="A. Author" afile.txt

The syntax `user.author="A. Author"` is not a valid way to specify an attribute name and value for the `setfattr` command.

Dsetfattr a user.author="A. Author" afile.txt

While `-a` is an option (for add), it's typically used with `-n` and `-v`, and the structure `a user.author="A. Author"` is an incorrect command syntax for setting an attribute and its value.

Concept tested: Setting Linux Extended Attributes (setfattr)

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

Topics

#Extended Attributes#setfattr command#File Attributes

Community Discussion

No community discussion yet for this question.

Full LFCS Practice