nerdexam
CompTIA

XK0-005 · Question #385

A Linux administrator needs to change the permission on a script so that the owner has permission to execute. Which of the following BEST accomplishes this task?

The correct answer is B. Chmod u+x script,sh. The administrator needs to grant execute permissions specifically to the owner of a script.

System Management

Question

A Linux administrator needs to change the permission on a script so that the owner has permission to execute. Which of the following BEST accomplishes this task?

Options

  • AChmod ug=script,sh
  • BChmod u+x script,sh
  • CChmod -x script,sh
  • DChmod 0644 script,sh

How the community answered

(42 responses)
  • A
    14% (6)
  • B
    74% (31)
  • C
    10% (4)
  • D
    2% (1)

Why each option

The administrator needs to grant execute permissions specifically to the owner of a script.

AChmod ug=script,sh

The `ug=script.sh` syntax is incorrect for specifying permissions within `chmod`.

BChmod u+x script,shCorrect

`Chmod u+x script.sh` correctly uses symbolic mode to add execute permission (`+x`) for the owner (`u`) of the specified script files, accomplishing the task.

CChmod -x script,sh

`Chmod -x` removes execute permissions for all users, which is the opposite of the desired outcome.

DChmod 0644 script,sh

`Chmod 0644` sets read/write for the owner but explicitly does not include execute permission.

Concept tested: Linux file permissions (chmod symbolic mode)

Source: https://www.gnu.org/software/coreutils/manual/html_node/chmod-invocation.html

Topics

#Linux Permissions#chmod command#File Execution#Symbolic Permissions

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice