Exam 101-400 All QuestionsBrowse all questions from this exam
Question 42

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

    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
davitnoreyanOption: D

D but we can remove rm -r dirname

DuboisNicolasDuclairOption: E

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

cast7omadrid1Option: D

la respuesta correcta es: D

cast7omadrid1

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

Yes the correct answer is D