101-400 Exam QuestionsBrowse all questions from this exam

101-400 Exam - Question 42


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

Show Answer
Correct Answer: E

To remove a directory whose name includes a backslash, such as '\dir', you need to escape the backslash in the command line. This is done using another backslash, resulting in '\\'. Therefore, the correct command to remove the subdirectory '\dir' in the user's home directory is 'rmdir ~/\\dir'. This tells the system to interpret the directory name correctly and not treat the backslash as an escape character.

Discussion

3 comments
Sign in to comment
cast7omadrid1Option: D
Mar 29, 2020

la respuesta correcta es: D

cast7omadrid1
May 16, 2020

I was wrong. If you create a directory with mkdir /\dir, you create a directory \dir. To eliminate it we need to escape \ that's why we use rmdir /\\dir

sis_net_sec
Apr 5, 2022

Yes the correct answer is D

DuboisNicolasDuclairOption: E
Oct 21, 2023

To remove the subdirectory `\dir` from the user's home directory, you can use the following command: E. `rmdir ~/\\dir` The backslash (`\`) is an escape character, and to use it as part of the directory name, you need to escape it with another backslash (i.e., `\\`). This way, the `rmdir` command will correctly interpret the directory name as `\dir`.

davitnoreyanOption: D
May 21, 2024

D but we can remove rm -r dirname