010-160 Exam QuestionsBrowse all questions from this exam

010-160 Exam - 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 Downloads is empty? (Choose two.)

Show Answer
Correct Answer: BE

To remove the 'Downloads' directory, assuming it is empty, you can use the 'rmdir Downloads' command, which is specifically designed to remove empty directories. Alternatively, you can use the 'rm -r Downloads' command, which recursively removes directories and their contents. Both commands are valid in this context, even though 'rm -r' can also handle non-empty directories.

Discussion

8 comments
Sign in to comment
JichzOptions: BE
Aug 10, 2020

B & E but the correct sentence in E is: rm -r Downloads

EricBStepOptions: BE
Mar 9, 2022

rm without any option (rm folder) is incapable of deleting a directory whether empty or full. rmdir folder will delete an empty directory and rm -r will delete a directory, empty or non-empty

capwanOptions: AE
Apr 21, 2021

B is not correct.Because "rmdir" delete only empty directories.

nikonik
May 10, 2021

Wich of the following commands can be used instead to remove Downloads, assuming Downloads is empty?

kimalto452
Sep 11, 2021

assuming Downloads is empty?

kimalto452
Sep 11, 2021

Downloads is empty?

kimalto452
Sep 11, 2021

is empty?

kimalto452
Sep 11, 2021

empty?

artmimois
Jul 5, 2022

EMPTY IT IS

DanYendler2014Options: BE
Dec 31, 2021

If "Downloads" is empty, then why do we need to -r to remove sub-directories? If there are sub-directories, then it's not empty. If it's empty, then the original command shouldn't have failed?

boss_ROMD
Sep 21, 2021

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 answer is B, because assuming the Downloads directory is empty answer E is related of below context: But, how do you delete a full directory that has many files and sub-directories? The solutions is to pass the -rf option to the rm command rm -r Downloads rm -rf Downloads so, my conclusion - must to be only answer B

TeesplintOption: E
Aug 9, 2023

The only correct option is E. rmdir will only delete an empty directory. rm -r will delete the folder together with it's content

Thuty07Options: BE
Aug 19, 2023

B. rmdir Downloads E. rm -r Downloads To remove an empty directory, you can use the rmdir command (Option B). If the directory is not empty and you want to remove it along with its contents, you can use the rm -r command (Option E). Options A, C, and D are not valid commands for removing directories.

kuzummjakkOptions: AE
Sep 22, 2023

Correction: B is wrong. Try it on a terminal.