LFCS · Question #704
Which command will print out the attributes of the file foobar?
The correct answer is B. Isattr foobar. The lsattr command is specifically designed to display the extended attributes of files on Linux filesystems like ext2, ext3, and ext4.
Question
Options
- AIs-attrfoobar
- BIsattr foobar
- Cprintattr foobar
- Dfileattr foobar
How the community answered
(46 responses)- A2% (1)
- B89% (41)
- C2% (1)
- D7% (3)
Why each option
The `lsattr` command is specifically designed to display the extended attributes of files on Linux filesystems like ext2, ext3, and ext4.
`ls-attrfoobar` is not a valid command; the hyphen is generally used for options, not as part of the command name.
The `lsattr` command is the standard utility in Linux to list the file attributes, such as immutable or append-only flags, set on files within ext2/ext3/ext4 filesystems. When used with a filename like `foobar`, it will print its attributes if any are set.
`printattr` is not a standard Linux command for displaying file attributes.
`fileattr` is not a standard Linux command for displaying file attributes.
Concept tested: Listing Linux file attributes
Source: https://man7.org/linux/man-pages/man1/lsattr.1.html
Topics
Community Discussion
No community discussion yet for this question.