In UNIX-like OS, which is the correct meaning of the command chmod u+x foo?
Accenture technical mcq question, verified with a worked answer. Free to practise - no sign-up.
In UNIX-like OS, which is the correct meaning of the command chmod u+x foo?
Show answer & explanation
Answer: A. Give execute permission to owner of the file named foo.
The chmod u+x foo command uses symbolic notation where u represents the file owner (user), + means add permission, and x means execute permission. This command adds execute permission to the owner only, without affecting group or other permissions. Option D is incorrect because chmod u+x does not remove permissions from other users—it only adds execute to the owner.
Step-by-step Derivation:
Breaking down chmod u+x foo:
u= user (owner) of the file+= add permission (additive operation)x= execute permissionfoo= target file name
Result: Execute permission is granted to the owner only. Group and others permissions remain unchanged.
Why other options are wrong:
- B:
g(notu) would target the group - C:
a(notu) would target all users - D:
chmod u+xis additive; it does not remove permissions from others