When reviewing file security configurations, a Linux administrator needs to determine if any files in a directory are set with the 'immutable' attribute to prevent alterations. Which command should the administrator use and what flag should they be looking for in the output?
Use the lsattr -a command and search for files with the 'a' flag
Use the lsattr command and look for files with the 'i' flag
Use the chattr command to check for the 'i' attribute
Use the lsattr -l command and look for a detailed list of attributes
The lsattr command is used to list the attributes of files. When looking for immutable files, the administrator should scan for the 'i' attribute in the command output. This attribute indicates that a file cannot be modified, deleted, or renamed, no links can be created to it, and no data can be written to the file. The chattr command is used for changing attributes, not listing them. The -a option for lsattr lists all files, but the 'a' attribute flag denotes 'append-only'. The lsattr command does not have a -l option for detailed output.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the 'i' attribute signify in Linux file permissions?
Open an interactive chat with Bash
How does the `lsattr` command differ from `chattr`?
Open an interactive chat with Bash
Can the immutable attribute ('i') be overridden by the root user?