Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI 010-160 Exam - Topic 3 Question 68 Discussion

Posted by Filiberto on Jun 18, 2026 at 04:27 AM

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.)

Suggested Answer: B, E

To remove a directory, you need to use a command that can delete directories, not just files. The rm command can only remove files by default, unless you use the -r option, which stands for recursive. This option tells rm to delete the directory and all of its contents, including subdirectories and files. The rmdir command can also remove directories, but only if they are empty. If the directory contains any files or subdirectories, rmdir will fail and display an error message. Therefore, the correct commands to remove Downloads, assuming it is empty, are rmdir Downloads and rm -r Downloads. The other commands are either invalid or do not work on directories.Reference:

Linux Essentials - Linux Professional Institute (LPI), section 2.3.1

LPI Linux Essentials Study Guide: Exam 010 v1.6, 3rd Edition, chapter 4, page 93.


Get Premium 010-160 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
18 comments · newest first
GL
Glenna 1 month ago
Same here, B) is clear and straightforward.
BL
Blair 1 month ago
I’m leaning towards just B) then.
SA
Samira 2 months ago
But it’s empty, so E) won’t apply here.
GL
Glenna 2 months ago
Yeah, B) and maybe E) could work if Downloads had files.
BL
Blair 2 months ago
I don't think A) is valid.
SA
Samira 2 months ago
Also, A) undir Downloads sounds like a good option, but I’m not sure.
GL
Glenna 2 months ago
Agreed, rmdir is definitely correct.
SA
Samira 2 months ago
I think B) rmdir Downloads is the right choice. It removes empty directories.
BL
Blair 3 months ago
I feel confused about this question.
KR
Kristeen 3 months ago
B is the only correct answer here, no doubt!
SO
Sommer 3 months ago
Wait, you can't just use rm for empty directories?
LE
Leana 3 months ago
Definitely B and maybe A, but A seems sketchy.
MA
Maurine 3 months ago
I thought rm could handle directories too?
LI
Lindsey 3 months ago
B) rmdir Downloads is the right choice!
AN
Antonio 4 months ago
I’m a bit confused about the options. I don’t think any of the other commands are valid for removing directories.
JO
Jordan 4 months ago
I practiced a similar question where we had to delete empty directories, and I think rmdir was the answer there too.
LA
Lajuana 4 months ago
I feel like rmdir is definitely one of the options, but I'm not sure about the other one.
TA
Tatum 4 months ago
I think I remember that to remove a directory, you can't just use rm unless you add a specific option.
0/2000 characters

Save Cancel