Question
A systems administrator wants to prevent the current contents of a file from being overwritten and wants to allow new additions at the end of the file. Which of the following commands should the administrator use?
- A. setenforce file
- B. setfacl -m m::t file
- C. chattr +a file Correct
- D. chmod +t file
Explanation
chattr +a sets the append-only attribute, so the file can be opened for writing only in append mode: existing data cannot be overwritten or truncated, but new data can be added at the end. setenforce switches the SELinux mode and does not act on a file. chmod +t sets the sticky bit, which controls deletion in directories, and setfacl changes ACL entries, not append behaviour.