Bird
0
0

Which of the following is the correct syntax to add execute permission for the user on a file named script.sh?

easy📝 Syntax Q12 of 15
Linux CLI - File Permissions and Ownership
Which of the following is the correct syntax to add execute permission for the user on a file named script.sh?
Achmod +x u script.sh
Bchmod script.sh u+x
Cchmod x+u script.sh
Dchmod u+x script.sh
Step-by-Step Solution
Solution:
  1. Step 1: Recall chmod symbolic syntax

    The correct format is chmod [who][operator][permission] filename. Here, 'u' means user, '+' adds permission, 'x' is execute.
  2. Step 2: Match syntax to options

    chmod u+x script.sh matches the correct syntax: chmod u+x script.sh. Other options have incorrect order or misplaced arguments.
  3. Final Answer:

    chmod u+x script.sh -> Option D
  4. Quick Check:

    chmod u+x filename adds execute for user [OK]
Quick Trick: Use chmod [u/g/o][+/-][r/w/x] filename [OK]
Common Mistakes:
  • Placing permissions before user
  • Putting filename before options
  • Using spaces inside symbolic mode

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes