LFCS · Question #743
LFCS Question #743: Real Exam Question with Answer & Explanation
The correct answer is D: chmod 755/bin/foo. The chmod 755 /bin/foo command sets file permissions so the owner has read, write, and execute permissions (7), while group and others have read and execute permissions (5), satisfying the requirement.
Question
Which of the following commands makes /bin/foo executable by everyone but writable only by its owner?
Options
- Achmod 557 /bin/foo
- Bchmod o+rwx.a+rx/bin/foo
- Cchown 557 /bin/foo
- Dchmod 755/bin/foo
Explanation
The chmod 755 /bin/foo command sets file permissions so the owner has read, write, and execute permissions (7), while group and others have read and execute permissions (5), satisfying the requirement.
Common mistakes.
- A.
chmod 557would make the file readable and executable by owner and group, but readable, writable, and executable by others, which is incorrect. - B. The syntax
o+rwx.a+rxis incorrect; the correct syntax for adding permissions would beo+rwx,a+rx. - C.
chownchanges file ownership, not permissions, making it irrelevant to the question's requirement.
Concept tested. Linux file permissions (chmod octal)
Reference. https://learn.microsoft.com/en-us/windows-server/administration/linux-reference/linux-commands/chmod
Topics
Community Discussion
No community discussion yet for this question.