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.
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)- A14% (6)
- B74% (31)
- C10% (4)
- D2% (1)
Why each option
The administrator needs to grant execute permissions specifically to the owner of a script.
The `ug=script.sh` syntax is incorrect for specifying permissions within `chmod`.
`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.
`Chmod -x` removes execute permissions for all users, which is the opposite of the desired outcome.
`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
Community Discussion
No community discussion yet for this question.