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
The chmod command modifies file permissions. The syntax u+x means 'user (owner) plus execute permission'. The u refers specifically to the owner/user, the + adds the permission, and x is execute. This command only grants execute to the owner without affecting group or other permissions—it does not remove permissions from others (ruling out D).
Step-by-step Derivation:
Breaking down chmod u+x foo:
chmod= change mode (permissions)u= user/owner+= add permissionx= execute bitfoo= target file
The three permission categories in Unix are: u (user/owner), g (group), o (others). This command operates only on 'u', so it only affects the owner. Option A correctly states this. Options B and C incorrectly reference group and all users respectively. Option D is incorrect because +x adds permissions without removing others' permissions—only −x would remove.