0
0
Linux CLIscripting~10 mins

Why permissions protect system security in Linux CLI - Test Your Understanding

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

Complete the command to list file permissions in long format.

Linux CLI
ls -l [1]
Drag options to blanks, or click blank then click option'
A-h
B-a
C/home/user
D-r
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-r' which reverses order but does not affect permissions display.
Using '-h' which shows sizes in human-readable format but not permissions.
2fill in blank
medium

Complete the command to change the owner of a file named 'report.txt' to user 'alice'.

Linux CLI
chown [1] report.txt
Drag options to blanks, or click blank then click option'
Aroot
Balice
Creport.txt
Duser
Attempts:
3 left
💡 Hint
Common Mistakes
Using the filename instead of the username.
Using 'root' or 'user' without context.
3fill in blank
hard

Fix the error in the command to add execute permission for the user on 'script.sh'.

Linux CLI
chmod u[1] script.sh
Drag options to blanks, or click blank then click option'
A-r
B-x
C+r
D+x
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-x' which removes execute permission.
Using '+r' which adds read permission instead.
4fill in blank
hard

Fill both blanks to create a command that sets read and write permissions for the group on 'data.txt'.

Linux CLI
chmod g[1][2] data.txt
Drag options to blanks, or click blank then click option'
A+r
B+w
C-x
D+x
Attempts:
3 left
💡 Hint
Common Mistakes
Adding execute permission instead of read or write.
Removing permissions with '-' instead of adding.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension in Python that maps filenames to their sizes only if size is greater than 1000.

Linux CLI
sizes = [1]: [2] for [3] in files if os.path.getsize([3]) > 1000
Drag options to blanks, or click blank then click option'
Afile
Bos.path.getsize(file)
Dfilename
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names inconsistently.
Not calling 'os.path.getsize' correctly.