Recall & Review
beginner
What does the
rm command do in Linux?The
rm command deletes files or directories from the file system permanently.Click to reveal answer
beginner
How do you remove a directory and all its contents using
rm?Use
rm -r directory_name. The -r option means recursive, so it deletes the directory and everything inside it.Click to reveal answer
beginner
What does the
-i option do with the rm command?The
-i option asks for confirmation before deleting each file. It helps prevent accidental deletion.Click to reveal answer
intermediate
Why should you be careful when using
rm -rf /?Because
rm -rf / deletes all files and directories starting from the root, which can erase your entire system and cause it to stop working.Click to reveal answer
beginner
How can you remove multiple files at once with
rm?You can list multiple files separated by spaces, like
rm file1.txt file2.txt file3.txt, and all will be deleted.Click to reveal answer
What does the command
rm -r myfolder do?✗ Incorrect
The
-r option means recursive deletion, so it removes the folder and everything inside.Which option makes
rm ask before deleting each file?✗ Incorrect
The
-i option stands for interactive mode, prompting for confirmation.What happens if you run
rm file.txt?✗ Incorrect
The
rm command deletes the specified file.What does the
-f option do with rm?✗ Incorrect
The
-f option forces deletion and ignores warnings or errors.Which command deletes multiple files at once?
✗ Incorrect
Listing multiple files after
rm deletes all those files.Explain how to safely delete a directory and its contents using the
rm command.Think about recursive deletion and asking before deleting.
You got /3 concepts.
Describe the risks of using
rm -rf / and why it should be avoided.Consider what happens when you delete everything on your computer.
You got /3 concepts.