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 command and look for files with the 'i' flag
Use the chattr command to check for the 'i' attribute
Use the lsattr -a command and search for files with the 'a' flag
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 to it can be created and no data can be written to the file. The -a option is not related to attribute flags and -l does not provide a more detailed output in the context of lsattr. The chattr command is used for changing attributes, not listing them.
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 'immutable' attribute mean in Linux file systems?
Open an interactive chat with Bash
How do you check if a file's attributes have changed after using 'chattr'?
Open an interactive chat with Bash
What is the difference between 'lsattr' and 'chattr' commands?