LPI
010-160 · Question #35
010-160 Question #35: Real Exam Question with Answer & Explanation
The correct answer is B: rmdir Downloads. The rm command refuses to remove directories without additional flags; use rmdir for empty directories or rm -r for recursive removal.
Question
Running the command rm Downloads leads to the following error:
rm: cannot remove `Downloads/': Is a directory
Which of the following commands can be used instead to remove Downloads, assuming Downloads is empty? (Choose two correct answers)
Options
- Aundir Downloads
- Brmdir Downloads
- Cdir 璞 Downloads
- Drem Downloads
- Erm 璞 Downloads
Explanation
The rm command refuses to remove directories without additional flags; use rmdir for empty directories or rm -r for recursive removal.
Common mistakes.
- A. 'undir' is not a valid Linux command and does not exist in any standard Linux distribution.
- C. 'dir' with a removal flag is not a valid Linux command for deleting directories.
- D. 'rem' is not a valid Linux shell command - it is associated with Windows batch scripting and has no equivalent function on Linux.
Concept tested. Removing directories with rmdir and rm -r
Reference. https://man7.org/linux/man-pages/man1/rmdir.1.html
Community Discussion
No community discussion yet for this question.