LX0-104 · 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. This question asks for the getfattr command that displays all extended attributes of a file along with their values.
Question
Options
- Agetfattr all afile.txt
- Bgetfattr afile.txt
- Cgetfattr list afile.txt
- Dgetfattr dump afile.txt
How the community answered
(57 responses)- A7% (4)
- B2% (1)
- C4% (2)
- D88% (50)
Why each option
This question asks for the `getfattr` command that displays all extended attributes of a file along with their values.
`all` is not a recognized option for `getfattr` to display all attributes and their values.
When `getfattr` is run without options like `-n` or `-d`, it typically lists only the names of the attributes, not their values.
`list` is not a valid option for `getfattr` to display attribute values; the `-l` or `--list` option lists only attribute names.
The `getfattr --dump` (or `-d`) option is specifically designed to list all extended attributes along with their values for the specified file in a format that includes both the attribute name and its content.
Concept tested: Listing Linux Extended Attributes
Source: https://linux.die.net/man/1/getfattr
Topics
Community Discussion
No community discussion yet for this question.