Courseiva
Essential CommandsmediumMultiple ChoiceObjective-mapped

LFCS Essential Commands Practice Question

A user is unable to execute a script in their home directory. The script has permissions -rw-r--r--. Which command will allow the user to execute the script?

⚠ Common exam trap

Candidates often confuse the 'user' (u) with 'others' (o) or think that removing execute (a-x) or setting 755 is the fix, but the question specifically requires the user to execute the script, so only adding execute for the owner (u+x) is correct.

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's permissions -rw-r--r-- indicate the owner has read and write but not execute. Both `chmod u+x script.sh` (adds execute for owner) and `chmod 755 script.sh` (sets owner to rwx, group/others to r-x) grant the user execute permission, allowing them to run the script. Option B is the minimal change, but option D also works; thus both are correct. Options A and C are incorrect because they would either remove execute or only add it for 'others', not the user.

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 a-x script.sh

    Why it's wrong here

    Incorrect: `chmod a-x` removes execute permission from all, which would not help and would actually remove any existing execute.

  • chmod u+x script.sh

    Why this is correct

    Correct: Adds execute permission for the owner (user), which directly allows the user to run the script.

  • chmod o+x script.sh

    Why it's wrong here

    Incorrect: `chmod o+x` adds execute for 'others', not the owner, so the user still cannot execute.

  • chmod 755 script.sh

    Why this is correct

    Correct: `chmod 755` sets permissions to rwxr-xr-x, granting the owner (user) execute permission along with read and write, thus allowing execution.

About these practice questions

This LFCS question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.