0
0
Linux CLIscripting~10 mins

Why environment setup customizes the shell 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 shell environment variable.

Linux CLI
echo $[1]
Drag options to blanks, or click blank then click option'
ASHELL
BHOME
CPATH
DUSER
Attempts:
3 left
💡 Hint
Common Mistakes
Using PATH instead of SHELL will show executable search paths, not the shell.
HOME shows your home directory, not the shell.
2fill in blank
medium

Complete the command to list all environment variables including custom shell settings.

Linux CLI
printenv | grep [1]
Drag options to blanks, or click blank then click option'
APATH
BUSER
CHOME
DSHELL
Attempts:
3 left
💡 Hint
Common Mistakes
Using PATH will show many unrelated variables.
USER or HOME do not relate to shell customization.
3fill in blank
hard

Fix the error in the command to set a custom prompt variable in the shell.

Linux CLI
export PS1=[1]
Drag options to blanks, or click blank then click option'
A"\u@\h:\w$ "
B'\u@\h:\w$ '
C\u@\h:\w$
D"\u@\h:\w$"
Attempts:
3 left
💡 Hint
Common Mistakes
Using single quotes causes the prompt to show raw backslashes.
No quotes cause syntax errors.
4fill in blank
hard

Fill both blanks to create an alias for listing files with details and human-readable sizes.

Linux CLI
alias ll='ls [1] [2]'
Drag options to blanks, or click blank then click option'
A-l
B-a
C-h
D-r
Attempts:
3 left
💡 Hint
Common Mistakes
Using -a shows hidden files but not size format.
Using -r reverses order, not size format.
5fill in blank
hard

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

Linux CLI
lengths = { [1] : [2] for [3] in words if len([3]) > 3 }
Drag options to blanks, or click blank then click option'
Aword
Blen(word)
Ditem
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names causes errors.
Not using len(word) as value misses the length.