Skip to main content
Linux AdministrationMediumSingle Choice

Linux Administration Question

Statement

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

#rmdir#backslash#quoting#tilde expansion#pathname
A

rmdir '~/\dir'

B

rmdir "~/\dir"

C

rmdir ~/'dir'

D

rmdir ~/\dir

E

rmdir ~/\dir

Correct

Resolution & Explanations

In shell commands, the backslash \ is an escape character. To represent a literal backslash, it must be escaped itself: \\.