CompTIA Linux+ (XK0-004) — Question 264

An administrator wants to prevent the accidental deletion of a business-critical application log file without affecting the functionality of the application and its logging. Which of the following commands would BEST accomplish this goal?

Answer options

Correct answer: B

Explanation

The command 'chattr +a application.log' allows the log file to be appended to but prevents it from being deleted, which is ideal for protecting critical logs. The other options either change permissions or ownership in ways that do not specifically prevent deletion, making them less suitable for this purpose.