0
0
Linux CLIscripting~10 mins

rm -r (remove directories) in Linux CLI - Interactive Code Practice

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

Complete the command to remove a directory named 'folder' and all its contents.

Linux CLI
rm [1] folder
Drag options to blanks, or click blank then click option'
A-a
B-r
C-l
D-f
Attempts:
3 left
💡 Hint
Common Mistakes
Using -f alone does not remove directories.
Using -l or -a are not valid options for removal.
2fill in blank
medium

Complete the command to force remove a directory named 'temp' without prompts.

Linux CLI
rm [1] temp
Drag options to blanks, or click blank then click option'
A-rf
B-r
C-f
D-ri
Attempts:
3 left
💡 Hint
Common Mistakes
Using only -r will ask for confirmation if files are write-protected.
Using -f alone won't remove directories.
3fill in blank
hard

Fix the error in the command to remove directory 'docs' and its contents.

Linux CLI
rm -r [1]
Drag options to blanks, or click blank then click option'
Adoc
B-docs
C--docs
Ddocs
Attempts:
3 left
💡 Hint
Common Mistakes
Adding dashes before directory names causes errors.
Misspelling the directory name.
4fill in blank
hard

Fill both blanks to remove directory 'cache' recursively and forcefully.

Linux CLI
rm [1] [2]
Drag options to blanks, or click blank then click option'
A-rf
Bcache
Clogs
D-r
Attempts:
3 left
💡 Hint
Common Mistakes
Using only -r without -f may cause prompts.
Forgetting to specify the directory name.
5fill in blank
hard

Fill all three blanks to remove directories 'build' and 'dist' recursively and forcefully.

Linux CLI
rm [1] [2] [3]
Drag options to blanks, or click blank then click option'
A-rf
Bbuild
Cdist
Dtemp
Attempts:
3 left
💡 Hint
Common Mistakes
Not using -rf causes errors when directories are not empty.
Misspelling directory names.