0
0
Linux CLIscripting~10 mins

Why Linux powers the internet 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 all files including hidden ones in a directory.

Linux CLI
ls [1]
Drag options to blanks, or click blank then click option'
A-a
B-l
C-h
D-r
Attempts:
3 left
💡 Hint
Common Mistakes
Using -l shows details but not hidden files.
Using -h is for human-readable sizes, not listing hidden files.
2fill in blank
medium

Complete the command to find the current working directory.

Linux CLI
[1]
Drag options to blanks, or click blank then click option'
Apwd
Bls
Ccd
Dwhoami
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ls' lists files but does not show current directory.
Using 'cd' changes directory but does not show it.
3fill in blank
hard

Fix the error in the command to display the first 5 lines of a file named 'log.txt'.

Linux CLI
head [1] log.txt
Drag options to blanks, or click blank then click option'
A-f 5
B-5
C-n 5
D-l 5
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-5' is not a portable option for head.
Using '-f' is for following a file, not line count.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps words to their lengths only 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)
Bword > 3
Clen(word) > 3
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'word > 3' compares strings to numbers, which is invalid.
Not using len() to get word length.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase words to their lengths only if length is greater than 4.

Linux CLI
{ [1]: [2] for word in words if [3] }
Drag options to blanks, or click blank then click option'
Aword.upper()
Blen(word)
Clen(word) > 4
Dword.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'word.lower()' instead of uppercase.
Not using len() to get length.
Using wrong comparison operators.