exam questions

Exam SK0-005 All Questions

View all questions & answers for the SK0-005 exam

Exam SK0-005 topic 1 question 146 discussion

Actual exam question from CompTIA's SK0-005
Question #: 146
Topic #: 1
[All SK0-005 Questions]

A Linux administrator created a script that will run at startup. After successfully writing the script, the administrator received the following output when trying to execute the script: hash: ./startUp.sh: Permission denied
Which of the following commands would BEST resolve the error message?

  • A. chmod +w startUp.sh
  • B. chmod 444 startUp.sh
  • C. chmod +x startUp.sh
  • D. chmod 466 startUp.sh
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
surfuganda
8 months ago
Selected Answer: C
The error message "Permission denied" indicates that the script lacks execute permission. In Linux, to execute a script, it must have the execute permission bit set. The correct command to resolve this error would be: C. chmod +x startUp.sh This command adds the execute permission (+x) to the script file "startUp.sh", allowing it to be executed.
upvoted 1 times
...
EngAbood
9 months, 4 weeks ago
Selected Answer: C
x = excute r = read w = write
upvoted 1 times
...
gingasaurusrex
1 year, 7 months ago
Selected Answer: C
C. chmod +x startUp.sh The error message "hash: ./startUp.sh: Permission denied" indicates that the script cannot be executed because it does not have the executable permission. To resolve the issue, the administrator should use the chmod command to add the executable permission to the script. The correct command is "chmod +x startUp.sh". This will add the executable permission for the owner of the file, allowing the script to be executed at startup. The other options do not address the issue of the script not having the executable permission. chmod +w would add the write permission, but this is not necessary for a script to run. chmod 444 would add read-only permission to the owner, group, and others, but again, this is not necessary for a script to run. chmod 466 would add read and write permission to the owner and group, but this still would not allow the script to be executed.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago