0
0
Linux CLIscripting~10 mins

Permission types (read, write, execute) in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to check if a file is readable by the user.

Linux CLI
if [ -[1] file.txt ]; then echo "Readable"; fi
Drag options to blanks, or click blank then click option'
Af
Br
Cx
Dw
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'w' or 'x' instead of 'r' for read check.
2fill in blank
medium

Complete the command to add write permission for the user on a file.

Linux CLI
chmod u[1] file.txt
Drag options to blanks, or click blank then click option'
A+w
B-r
C+x
D-w
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-w' which removes write permission.
3fill in blank
hard

Fix the error in the command to execute a script named 'run.sh'.

Linux CLI
./[1]
Drag options to blanks, or click blank then click option'
Arun
Brunsh
Crun.sh
Drun.sh.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the '.sh' extension.
4fill in blank
hard

Fill both blanks to create a command that removes execute permission for group and others.

Linux CLI
chmod [1][2] file.txt
Drag options to blanks, or click blank then click option'
Ago-
Bu-
Cx
Dw
Attempts:
3 left
💡 Hint
Common Mistakes
Removing write permission instead of execute.
5fill in blank
hard

Fill all three blanks to create a command that adds read and write permissions for user and execute for others.

Linux CLI
chmod u[1],o[2] file.txt # Add [3] permission for others
Drag options to blanks, or click blank then click option'
A+rw
B+x
Cexecute
D-x
Attempts:
3 left
💡 Hint
Common Mistakes
Removing execute permission instead of adding.