LPIC-1 Exam 101 (Linux Administrator) — Question 4
A user accidentally created the subdirectory \dir in his home directory. Which of the following commands will remove that directory?
Answer options
- A. rmdir '~/\dir'
- B. rmdir "~/\dir"
- C. rmdir ~/'dir'
- D. rmdir ~/\dir
- E. rmdir ~/\\dir
Correct answer: E
Explanation
The correct answer is E because it accurately references the directory with the correct escape characters needed to handle the backslash in the command. Options A and B incorrectly use single and double quotes, preventing proper interpretation of the path. Option C does not include the backslash at all, and option D mistakenly does not escape the backslash.