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 command syntax is chmod [who][operator][permission] file. Here, u means "user" (owner), + means "add", and x means "execute". So u+x adds execute permission specifically to the owner. Option D is incorrect because chmod u+x only modifies the owner's permission without removing execute permission from others; it's a pure addition operation.

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

  • u = user (file owner)
  • + = add/grant permission
  • x = execute permission
  • foo = target file

Result: Execute permission is added ONLY to the owner. Other users' permissions remain unchanged. This matches option A exactly. Option B refers to g (group), option C refers to a (all), and option D incorrectly claims removal of permissions from others, which doesn't happen with the + operator.