Bird
0
0

Which command correctly adds execute permission to a script named backup.sh for all users?

easy📝 Syntax Q3 of 15
Bash Scripting - Basics
Which command correctly adds execute permission to a script named backup.sh for all users?
Achmod 000 backup.sh
Bchmod 644 backup.sh
Cchmod -r backup.sh
Dchmod +x backup.sh
Step-by-Step Solution
Solution:
  1. Step 1: Identify the command to add execute permission

    chmod +x adds execute permission to the file for user, group, and others.
  2. Step 2: Analyze options

    chmod +x backup.sh uses chmod +x backup.sh, which is correct.
    chmod 644 backup.sh sets permissions to 644 (read/write for owner, read for group/others), no execute.
    chmod -r backup.sh uses -r which is invalid.
    chmod 000 backup.sh sets permissions to 000, removing all permissions.
  3. Final Answer:

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

    Does the command add execute permission? Yes [OK]
Quick Trick: chmod +x filename adds execute permission [OK]
Common Mistakes:
MISTAKES
  • Using numeric modes without execute bits
  • Using invalid chmod flags

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes