nerdexam
CompTIA

LX0-103 · Question #104

Which command will print out the attributes of the file foobar?

The correct answer is B. Isattr foobar. The lsattr command displays the extended filesystem attributes (such as immutable or append-only flags) of a specified file.

GNU and Unix Commands

Question

Which command will print out the attributes of the file foobar?

Options

  • AIs-attrfoobar
  • BIsattr foobar
  • Cprintattr foobar
  • Dfileattr foobar

How the community answered

(26 responses)
  • B
    92% (24)
  • C
    4% (1)
  • D
    4% (1)

Why each option

The `lsattr` command displays the extended filesystem attributes (such as immutable or append-only flags) of a specified file.

AIs-attrfoobar

`ls-attrfoobar` is malformed - the tokens are concatenated without spaces, and the `ls` command has no `-attr` option for reading inode-level filesystem attributes.

BIsattr foobarCorrect

`lsattr foobar` (shown as 'Isattr' due to a font rendering artifact where lowercase 'l' resembles 'I') is the standard Linux command for displaying inode-level filesystem attribute flags set by `chattr`, such as immutable (+i), append-only (+a), and no-dump (+d). It reads these flags directly from the filesystem and prints them for the specified file.

Cprintattr foobar

`printattr` is not a standard Linux command and does not exist in common distributions for displaying filesystem-level inode attributes.

Dfileattr foobar

`fileattr` is not a standard Linux utility; the correct command for listing inode-level filesystem attributes assigned by `chattr` is `lsattr`.

Concept tested: Linux lsattr command for displaying inode filesystem attributes

Source: https://man7.org/linux/man-pages/man1/lsattr.1.html

Topics

#lsattr#file attributes#extended attributes

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice