Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to make the script named myscript.sh executable.
Bash Scripting
chmod [1] myscript.sh Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
-r or -w which remove permissions instead of adding execute.Using
+r which only adds read permission, not execute.✗ Incorrect
The
+x option adds execute permission to the file, making it executable.2fill in blank
mediumComplete the command to make the script run.sh executable for the user only.
Bash Scripting
chmod u[1] run.sh Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
-x which removes execute permission.Using
+r which adds read permission, not execute.✗ Incorrect
The
u+x option adds execute permission for the user (owner) only.3fill in blank
hardFix the error in the command to make script.sh executable for all users.
Bash Scripting
chmod [1] script.sh Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
a-x which removes execute permission.Using
u-x or g-x which remove execute permission for user or group.✗ Incorrect
The
a+x option adds execute permission for all users (user, group, others).4fill in blank
hardFill both blanks to make deploy.sh executable only for the group and others.
Bash Scripting
chmod [1],[2] deploy.sh
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
u+x which adds permission to user instead of group or others.Using
a+x which adds permission to all users.✗ Incorrect
Adding
g+x and o+x gives execute permission to group and others only.5fill in blank
hardFill all three blanks to add execute permission for user and remove read permission for others on script.sh.
Bash Scripting
chmod [1],[2],[3] script.sh
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
+x without specifying user or group.Confusing
-r with adding permissions instead of removing.✗ Incorrect
The command adds execute permission for user (
u+x) and removes read permission for others (o-r), with -r as the option to remove read permission.