CompTIA Linux+ (XK0-004) — Question 92
A member of the production group issues the following command: echo "Monday through Friday" > /production_docs/days
The command fails to execute, so the user obtains the following output: drwxr--r-- root production 0 Jun 16 2018 production
-rw-r--r-- production production 4096 Jun 14 2018 days
Which of the following commands should the user execute to BEST fix the issue?
Answer options
- A. chmod g+w production to change the permissions on the days file
- B. chgrp root production_docs/days to change the group ownership of the production_docs/days file
- C. chmod g+S production to set the GUID on the production_docs directory
- D. chown production to change the ownership of the production_docs directory
Correct answer: A
Explanation
The correct answer is A because the user needs to add write permission for the group on the 'days' file to allow the command to succeed. The other options either change ownership or permissions incorrectly, or do not address the specific issue of file write permissions needed for the command to execute successfully.