0
0
Linux CLIscripting~10 mins

Why sysadmin skills manage production servers 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 code to display the current logged-in users on a Linux server.

Linux CLI
who [1]
Drag options to blanks, or click blank then click option'
A-u
B-l
C-a
D-r
Attempts:
3 left
💡 Hint
Common Mistakes
Using -a shows all information but is verbose.
Using -l shows login processes, not users.
Using -r shows runlevel, not users.
2fill in blank
medium

Complete the command to check disk usage in human-readable format.

Linux CLI
df [1]
Drag options to blanks, or click blank then click option'
A-l
B-a
C-h
D-t
Attempts:
3 left
💡 Hint
Common Mistakes
Using -a shows all filesystems including dummy ones.
Using -l limits output to local filesystems only.
Using -t filters by filesystem type.
3fill in blank
hard

Fix the error in the command to restart the Apache web server using systemctl.

Linux CLI
sudo systemctl [1] apache2
Drag options to blanks, or click blank then click option'
Arestart
Benable
Cstatus
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using start only starts the service if stopped.
Using enable sets service to start on boot but doesn't restart.
Using status only shows service status.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps each word to its length if length is greater than 3.

Linux CLI
{word: [1] for word in words if [2]
Drag options to blanks, or click blank then click option'
Alen(word)
Blen(word) > 3
Cword.startswith('a')
Dword.upper()
Attempts:
3 left
💡 Hint
Common Mistakes
Using word.upper() as value instead of length.
Using word.startswith('a') as condition instead of length check.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase keys to values only if value is positive.

Linux CLI
{ [1]: [2] for [3], [2] in data.items() if [2] > 0 }
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
Ck
Ditem
Attempts:
3 left
💡 Hint
Common Mistakes
Using item instead of k and v in the loop.
Not converting keys to uppercase.