easyMultiple Choice
220-1102 Practice Question: That they cannot execute a shell script they…
A user reports that they cannot execute a shell script they wrote in their home directory. The script has permissions -rw-r--r--. Which command should be used to allow the owner to execute the script?
⚠ Common exam trap
CompTIA often tests the distinction between adding a specific permission (u+x) versus setting an absolute mode (755), where candidates may choose 755 because it 'works' without recognizing it unnecessarily grants execute to group and others.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
chmod u+x script.sh
The script currently has permissions -rw-r--r--, meaning the owner has read and write but not execute. The command chmod u+x adds execute permission for the owner (u) without affecting other permissions. This directly addresses the user's inability to execute the script by granting the missing execute bit to the owner.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
chmod 755 script.sh
Why it's wrong here
chmod 755 grants execute to owner, group and others, plus write to the group, altering permissions beyond the owner's requirement. It is tempting because it reliably adds the execute bit, and would suit shared scripts needing group read-execute access, but the question asks only to let the owner execute.
- ✓
chmod u+x script.sh
Why this is correct
The file mode -rw-r--r-- grants the owner read and write but no execute bit. chmod u+x adds execute permission for the owner only, leaving group and other permissions unchanged, allowing the owner to run the script.
- ✗
chmod +r script.sh
Why it's wrong here
chmod +r adds read permission, which the file already carries via -rw-r--r--, leaving the missing execute bit unset. It is tempting because the + operator feels like a general permission fix, and it would be right for a file the owner cannot read, not one they cannot execute.
- ✗
chmod 644 script.sh
Why it's wrong here
chmod 644 sets rw- for owner, r-- for group and others, leaving no execute bit anywhere, so the script stays unrunnable. It is tempting because 644 is the common default for plain text files; it would be correct for a data file the owner edits but never executes.
Go deeper
Related to this question
About these practice questions
Courseiva writes every 220-1202 question from scratch — 687 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 220-1202 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 220-1202 exam.