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
chmod u+x foo modifies permissions using the symbolic mode syntax. The u stands for 'user' (file owner), + means add the permission, and x means execute permission. This command adds execute permission only to the owner without affecting group or others. Option D is incorrect because the + operator adds permissions without removing permissions from others—only chmod u=x foo (with =) would overwrite and remove other permissions.
Step-by-step Derivation:
Breaking down chmod u+x foo:
u= user (owner of the file)+= add this permission (does not remove existing permissions)x= execute permissionfoo= target file
Result: Execute permission is added to the owner's existing permissions only. Group and others remain unchanged.