Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'w' or 'x' instead of 'r' for read check.
✗ Incorrect
The -r flag checks if the file is readable.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-w' which removes write permission.
✗ Incorrect
The +w adds write permission for the user.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the '.sh' extension.
✗ Incorrect
The script file must be named exactly with its extension to execute it.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Removing write permission instead of execute.
✗ Incorrect
go- targets group and others, x is execute permission to remove.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Removing execute permission instead of adding.
✗ Incorrect
u+rw adds read and write for user, o+x adds execute for others, which is the execute permission.