0
0
Linux CLIscripting~10 mins

Terminal vs GUI in Linux CLI - Interactive Practice

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

Complete the code to list all files in the current directory using the terminal.

Linux CLI
ls [1]
Drag options to blanks, or click blank then click option'
A-a
B-x
C-z
D-l
Attempts:
3 left
💡 Hint
Common Mistakes
Using options that do not list hidden files.
Typing the command without any options.
2fill in blank
medium

Complete the command to display the current working directory path.

Linux CLI
[1]
Drag options to blanks, or click blank then click option'
Apwd
Bcd
Cls
Ddir
Attempts:
3 left
💡 Hint
Common Mistakes
Using ls which lists files but does not show the path.
Using cd which changes directory but does not display path.
3fill in blank
hard

Fix the error in the command to copy a file named 'report.txt' to the folder 'backup'.

Linux CLI
cp report.txt [1]
Drag options to blanks, or click blank then click option'
Areport_backup
Bbackup.txt
Cbackup/
Dbackup.txt/
Attempts:
3 left
💡 Hint
Common Mistakes
Using a file name instead of a folder as destination.
Adding a slash after a file name.
4fill in blank
hard

Fill both blanks to create a hidden file named '.config' using the terminal.

Linux CLI
touch [1][2]
Drag options to blanks, or click blank then click option'
A.
Bconfig
Cconfig.txt
Dhidden
Attempts:
3 left
💡 Hint
Common Mistakes
Not adding the dot at the start.
Adding an extension like '.txt' which is not required here.
5fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps file names to their lengths for files longer than 3 characters.

Linux CLI
file_lengths = {: {BLANK_2}} for [2] in files if len({{BLANK_3}}) > 3
Drag options to blanks, or click blank then click option'
Af
Blen(f)
D{
Attempts:
3 left
💡 Hint
Common Mistakes
Not starting the dictionary with a brace.
Using inconsistent variable names.
Not filtering files by length.