OA. free
Free
Accenture Core Computer Science Core Computer Science Medium

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?

Choose one option.
Show answer & explanation
Answer: A. Give execute permission to owner of the file named foo.

The chmod u+x foo command uses symbolic mode to modify file permissions. The u refers to the user (owner), + means add, and x means execute permission. This only grants execute permission to the file owner without affecting group or other permissions. Option D is incorrect because the + operator adds permission without removing permissions from others; only a combination of - operations would remove permissions.

Step-by-step Derivation:
Breaking down chmod u+x foo:

  • u = user (owner) of the file
  • + = add permission (does not remove existing permissions)
  • x = execute permission
  • foo = the target file

So the command adds execute permission for the owner only. It does NOT affect group (g) or others (o) permissions, and it does NOT remove permissions from other users (that would require explicit - operations like u+x,g-x,o-x). Therefore, option A is the precise and correct answer.