CompTIA Linux+ Powered by LPI (LX0-103) — Question 21
Which of the following commands makes /bin/foo executable by everyone but writable only by its owner?
Answer options
- A. chmod u=rwx,go=rx /bin/foo
- B. chmod o+rwx,a+rx /bin/foo
- C. chmod 577 /bin/foo
- D. chmod 775 /bin/foo
Correct answer: A
Explanation
The command 'chmod u=rwx,go=rx /bin/foo' correctly sets the permissions so that the owner has read, write, and execute permissions, while the group and others have read and execute permissions only. The other options either grant inappropriate write permissions to others or do not restrict writing as required.