CompTIA Linux+ Powered by LPI (LX0-103) — Question 6

A user accidentally created the subdirectory \dir in his home directory. Which of the following commands will remove that directory?

Answer options

Correct answer: E

Explanation

The correct answer is E because it properly escapes the backslashes needed to reference the directory name. Options A and B do not escape the backslashes correctly, leading to incorrect directory references. Option C is incorrect as it refers to 'dir' without the escape characters, and option D also fails to correctly escape the backslashes needed for the directory name.