nerdexam
CompTIA

SK0-005 · Question #174

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…

The correct answer is C. Chmod+x startup.sh. This is the command that would best resolve the error message "Bash ./startup.sh: Permission denied" when trying to execute a script on Linux. Chmod is a command that changes the permissions of files or directories on Linux. +x is an option that adds the execute permission to…

Troubleshooting

Question

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?

Options

  • AChmod +w startup.sh
  • BChmod 444 startup.sh
  • CChmod+x startup.sh
  • DChmod 466 startUp,sh

How the community answered

(46 responses)
  • A
    2% (1)
  • B
    4% (2)
  • C
    91% (42)
  • D
    2% (1)

Explanation

This is the command that would best resolve the error message "Bash ./startup.sh: Permission denied" when trying to execute a script on Linux. Chmod is a command that changes the permissions of files or directories on Linux. +x is an option that adds the execute permission to the file or directory for the owner, group, and others. startup.sh is the name of the script file that needs to be executed. By running chmod +x startup.sh, the technician grants execute permission to the script file and allows it to be run by any user. Chmod +w startup.sh would add write permission to the file, but not execute permission. Chmod 444 startup.sh would set read-only permission for all users, but not execute permission. Chmod 466 startup.sh would set read and write permission for the owner and write-only permission for group and others, but not execute

Topics

#Linux File Permissions#chmod command#Script Execution#Troubleshooting

Community Discussion

No community discussion yet for this question.

Full SK0-005 Practice