010-160 · Question #35
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…
The correct answer is B. rmdir Downloads E. rm 璞 Downloads. The rm command refuses to remove directories without additional flags; use rmdir for empty directories or rm -r for recursive removal.
Question
Options
- Aundir Downloads
- Brmdir Downloads
- Cdir 璞 Downloads
- Drem Downloads
- Erm 璞 Downloads
How the community answered
(45 responses)- A2% (1)
- B87% (39)
- C4% (2)
- D7% (3)
Why each option
The rm command refuses to remove directories without additional flags; use rmdir for empty directories or rm -r for recursive removal.
'undir' is not a valid Linux command and does not exist in any standard Linux distribution.
The 'rmdir' command is specifically designed to remove empty directories, making it a valid choice when the Downloads directory contains no files or subdirectories.
'dir' with a removal flag is not a valid Linux command for deleting directories.
'rem' is not a valid Linux shell command - it is associated with Windows batch scripting and has no equivalent function on Linux.
The 'rm -r' command enables recursive deletion, which allows rm to remove a directory and all its contents - and also works correctly on empty directories.
Concept tested: Removing directories with rmdir and rm -r
Source: https://man7.org/linux/man-pages/man1/rmdir.1.html
Topics
Community Discussion
No community discussion yet for this question.