Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to remove a file named example.txt.
Linux CLI
rm [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using options like -r or -f without a filename.
Typing the filename incorrectly.
✗ Incorrect
The
rm command followed by the filename example.txt deletes that file.2fill in blank
mediumComplete the code to force remove a file named data.log without any prompt.
Linux CLI
rm [1] data.log Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
-i which asks for confirmation.Using
-r which is for directories.✗ Incorrect
The
-f option forces removal without asking for confirmation.3fill in blank
hardFix the error in the command to remove a directory named backup and all its contents.
Linux CLI
rm [1] backup Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
-f alone does not remove directories.Forgetting the recursive option causes an error.
✗ Incorrect
The
-r option tells rm to remove directories and their contents recursively.4fill in blank
hardFill both blanks to remove all files with .tmp extension in the current directory without prompt.
Linux CLI
rm [1] [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
-r which is for directories, not files.Using
-i which asks for confirmation.✗ Incorrect
Use
-f to force removal and *.tmp to select all files ending with .tmp.5fill in blank
hardFill all three blanks to remove a directory named logs and all its contents forcefully and quietly.
Linux CLI
rm [1] [2] [3] logs
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
-i which asks for confirmation.Forgetting
-r for directories.✗ Incorrect
Use
-r for recursive removal, -f to force deletion, and -q to suppress output.